Git Product home page Git Product logo

Comments (10)

sayfee avatar sayfee commented on May 18, 2024 10

I know it's been a while since someone posted on this thread, but I wanted to point out that if you just go to project/properties/build and use 64bits, that should fix the issue

from tensorflowsharp.

cesarsouza avatar cesarsouza commented on May 18, 2024 1

Hi Dom Li,

I think that Miguel's suggestion was to run that given command in a PowerShell environment within Windows itself, not exactly under VirtualBox. You might need to install bazel through Chocolatey first, though.

Regards,
Cesar

from tensorflowsharp.

luketg8 avatar luketg8 commented on May 18, 2024 1

Hi,

I tried this. What happens is you need to run ./configure in the TensorFlow repository before you can build this shared libraries. This presents issues in that every time it got past the 'Python Libraries stage' it would simply restart. This has been frustrating as I know my Bazel build for windows works as I tried building some examples, so it just seems like another hurdle to get over!

from tensorflowsharp.

migueldeicaza avatar migueldeicaza commented on May 18, 2024

You need to get a native build of libtensorflow.dll for Windows for this to work

TensorFlowSharp.dll is the managed code (the cross platform code) which calls into the native code (libtensorflow.dll). So you do need to build the latter on Windows for this to work.

from tensorflowsharp.

DomLi avatar DomLi commented on May 18, 2024

from tensorflowsharp.

migueldeicaza avatar migueldeicaza commented on May 18, 2024

from tensorflowsharp.

DomLi avatar DomLi commented on May 18, 2024

from tensorflowsharp.

aminullah6264 avatar aminullah6264 commented on May 18, 2024

hi,
i getting the same error

System.BadImageFormatException occurred
HResult=0x8007000B
Message=Could not load file or assembly 'TensorFlowSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

i have both dll files build in my project TensorFlowSharp.dll and libtensorflow.dll

this is my code, could anyone help me to solve this problem
i really problematic for this

try
{
var graph = new TFGraph();
// Load the serialized GraphDef from a file.
var model = File.ReadAllBytes("D:\Projects\ImageROICollection\ImageROICollection\overfeat_rezoom_2017_07_15_12.51\save.ckpt-10000");
graph.Import(model, "");
using (var session = new TFSession(graph))
{
var tensor = CreateTensorFromImageFile(filesName[mainIndex]);
var runner = session.GetRunner();
runner.AddInput(graph["input"][0], tensor);
runner.Fetch(graph["output"][0]);

                var output = runner.Run();

                // Fetch the results from output:
                TFTensor result = output[0];
                MessageBox.Show(result.ToString());

            }
        }
        catch(Exception ex)
        {
            MessageBox.Show(ex.ToString());
        }

from tensorflowsharp.

aminullah6264 avatar aminullah6264 commented on May 18, 2024

hi,
i getting the same error

System.BadImageFormatException occurred
HResult=0x8007000B
Message=Could not load file or assembly 'TensorFlowSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

i have both dll files build in my project TensorFlowSharp.dll and libtensorflow.dll

this is my code, could anyone help me to solve this problem
i really problematic for this

try
{
var graph = new TFGraph();
// Load the serialized GraphDef from a file.
var model = File.ReadAllBytes("D:\Projects\ImageROICollection\ImageROICollection\overfeat_rezoom_2017_07_15_12.51\save.ckpt-10000");
graph.Import(model, "");
using (var session = new TFSession(graph))
{
var tensor = CreateTensorFromImageFile(filesName[mainIndex]);
var runner = session.GetRunner();
runner.AddInput(graph["input"][0], tensor);
runner.Fetch(graph["output"][0]);

            var output = runner.Run();

            // Fetch the results from output:
            TFTensor result = output[0];
            MessageBox.Show(result.ToString());

        }
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }

from tensorflowsharp.

Biirra avatar Biirra commented on May 18, 2024

Good work sayfee That worked like a charm.

from tensorflowsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.