-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DLL Not Found Exception #252
Comments
@eduardobellotto Try to install another redist provided by Microsoft https://www.nuget.org/packages/Microsoft.ML.TensorFlow.Redist PM> Install-Package Microsoft.ML.TensorFlow.Redist |
Hi @Oceania2018 I've installed the Microsoft.ML.TensorFlow.Redist version 0.12.0, but I still have the same exception. |
Hello @eduardobellotto, just make sure the package reference is there and do a full build:
|
@Oceania2018 it seems this problem always be an obstacle for the beginners of TF.NET. I forgot this issue many times as well. |
Hi @kerryjiang. I've migrate the
I also created a brand new project with the default package management The project was created with the same right reference above. But the exception continues in both cases. Thanks again. |
@eduardobellotto .NET 4.7.2 is the first version of the full .NET Framework that is fully .NET Standard 2.0 compliant without any additional dependencies. Can you try to upgrade your .NET Framework first? |
Hi @Oceania2018. I've created a new project targeting .NET Framework 4.7.2 with the Nugets Thanks once more. |
@eduardobellotto This is what my files look like: |
Hi I copy the "tensorflow.dll" file to Debug folder to test. I worked in that case. It is not the solution, but a small hack lets say. Problem is why it is not found originally. |
Hi @Oceania2018 and @tradexdev. I've discovered that this copy and paste solution works just for a .NET Core project. I have a .NET Framework 4.6.2 project that has some dependencies to this framework and I would like to use TensorFlow in that project. I've tried to create a solution with two different projects: a .NET Framework 4.6.2 and a .NET Core 2.0 project, but the Visual Studio does not permit us to reference the two projects directly. I've found a workaround way to create that dependency in this link: https://www.youtube.com/watch?v=qc2WFaMfdp8&t=485s and I've followed this example. It is interesting that TensorFlow works then we call the method from the own .NET Core application, but throws the exception when we try to call the same method of the same .NET Core app class from the .NET Framework application. I have already tried to create an intermediate .NET Standard library project, referenced by the other two projects, but it has trown the same exception. I'd like to ask you a favor. Could you create a project from scratch, with .NET Framework 4.6.2 and the Nuget packages cited above and see if it works on your computers? I would like to know if the problem with the .NET Framework would also occur on your computer, so if it is a problem with the .NET Framework. Thank you very much for the help! |
@eduardobellotto Just make sure you're running x64 platform. |
Bingo! Its working now! For those who are facing the same difficulty, just follow these steps:
As Haiping has shown above, the application is working fine: Thank you very much @Oceania2018, @kerryjiang and @tradexdev, for the great help! |
That almost worked for me. Added |
In my cases, everything works fine when running on my computer, but the exception raises when I bring the Debug folder to other computers. Does it happen because of lacking environment? If yes, please help me out some possible fixes. At first, the message is 'Unable to load DLL 'tensorflow''. Then after I installed C++ Redistributed in the client's computer, the message changed to "Unable to load DLL 'tensorflow': A dynamic link library (DLL) initialization failed. I did build in x64. |
I had same issues but every time I solved one with advices from this thread, I was getting other errors which went deeper and deeper into the system until it had already nothing to do with TensorFlow anymore. What helped me is to create completely new project ad install a bit older versions of NuGet packages (I used Microsoft.ML 1.6, Microsoft.ML.ImageAnalytics 1.6, Microsoft.ML.Visions 1.6 and SciSharp.TensorFlow.Redist 2.3.1. These are versions of packages which VS 2022 ML Model Builder uses, and there everything works ok |
Hi.
I've created a new project in Windows 10 VS 2019 targeting .NET Framework 4.6.2.
Then, I've installed the Tensorflow.NET Nuget Package version 0.8.0.
In Program class, I've inserted
using Tensorflow;
.In Main method, I've inserted the code
var a = tf.constant(3);
.When I run the code, I receive the exception:
DllNotFoundException: Unable to load DLL 'tensorflow': The specified module could not be found.
.I've found the closed issue #144 (Cannot load Tensorflow DLL error), but I was not able to solve the problem after reading it.
There is a
TensorFlow.NET.dll
file in..\bin\Debug
folder, but there is noTensorFlow.dll
file in that folder.I've found a
TensorFlow.dll
file in..\packages\TensorFlow.NET.0.8.0\tensorflowlib\runtimes\win-x64
folder.I've tried to copy this file to the
..\bin\Debug
folder, but the error persisted.I've tried the same with VS 2017 and received the same exception.
Could you help me?
Thanks in advance.
The text was updated successfully, but these errors were encountered: