-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
The type or namespace name 'TensorFlow' could not be found #1511
Comments
As described here, make sure you installed that one: That could be the source of your issue. |
Thanks for the reply, but I have installed TFSharpPlugin. I described it here in my initial post: "I installed TFSharpPlugin (by double clicking it. And I keep it in a different folder than Unity if it made any difference... i'm becoming paranoid.. :))" |
Just wanted to make sure we both installed the same ;)
Also, I can confirm it doesn't make any difference to keep the
.unitypackage inside or outside of the project folder.
One difference I can see with my (working) project is the API compatibility
level in Player Settings. Mine is set to ".Net Standard 2.0" (while yours
seems to be set to ".Net 4")
…On Wed, Dec 19, 2018, 8:54 PM oddEventHorizon ***@***.*** wrote:
As described here
<https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Using-TensorFlow-Sharp-in-Unity.md>,
make sure you installed that one:
https://s3.amazonaws.com/unity-ml-agents/0.5/TFSharpPlugin.unitypackage
That could be the source of your issue.
Thanks for the reply, but I have installed TFSharpPlugin. I described it
here in my initial post:
"I installed TFSharpPlugin (by double clicking it. And I keep it in a
different folder than Unity if it made any difference... i'm becoming
paranoid.. :))"
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1511 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAI75RUAEIVq1PthbAK_wiaHhDlO7CYNks5u6xgLgaJpZM4ZbYcs>
.
|
I had this issue migrating from 0.5 to 0.6, and fixed it by reimporting TFsharp (on Ubuntu import package -> custom package) and it's located in Assets/Plugin |
@13Flo - thanks for noticing it, however it did not fix my issue. I changed it to .NET Standrad 2.0 regardless as I'm not sure why it was changed. @louis030195 - thank you for your reply. The only reference of TFSharpPlugin I found was in here: I double clicked the TFSharpPlugin.unitypackage file - assumed it will target itself correctly. |
Do you get errors in the Unity Editor, or just in VS Code? |
Hi. I have been trying desperately to find what broke it and potential workaround that I've came up with this. When mentioned issue occurs in VS Code about tensorflow namespace or type not found, I open my Visual Studio 2017 Community. I open my project solution properties and I change: Target Framework from: .NET Framework 4.5 to: .NET Framework 4.6.1 Then I go back to VS Code and all the compilation errors are gone. However If I close VS Code (that had no issues at the moment of closing) and I reopen it with Unity->Assets->Open C# Project - the problem occurs again. It seems as if Unity was forcing .NET Framework 4.5 for some reason. However as much as I'm happy that I have found a workaround I doubt it's a proper solution and I assume there is be some mistake that I'm making. |
That could be a good occasion to switch to Jetbrains Rider... ;) |
@13Flo : yeah, but the price :) |
Update: I have noticed that until I change .NET Framework via Visual Studio Community 2017 I'm getting this printed out in the OmniSharp Log output window:
I also almost certain that this issue was not occuring on Unity 2017 where I was able to specifically pick which .NET Framework 4.6 from the Scripting Runtime Version field in the Project Settings. In Unity 2018 you can only specify .NET Framework 4.x (equivalent). Maybe it's hardcoded to 4.5 somewhere? |
We have replaced TF# with our internal inference solution as of v0.7. Closing this issue for now. Please feel free to re-open if you deem it necessary. |
@awjuliani I am using the v0.7 ml-agent, and unity 2018.3.11. Still facing the same issue. Step to reproduce the setup |
Hi @weiweitoo , since we got rid of TensorflowSharp, please remove the ENABLE_TENSORFLOW symbol, and it should be working. |
@xiaomaogy Cool. It works perfectly. Thanks! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi,
I've stumbled upon this problem when trying to experiment with ML Agents. I have noticed that few other people got stuck on it as well but none of them has really replied here with a solution that would help in my case or replied with any solution at all.
ISSUE:
When I put "ENABLE_TENSORFLOW" into the Scripting Define Symbols fields my VS Code is getting red all over the "using Tensorflow;" in TFSharpInferenceEngine.cs
Screenshot:
My setup:
ML Agents: v0.6 - had the same problem on v0.5 as well
Unity version: 2018.3.0f2 (official) - had this issue on 2018.3.0f1 (beta) as well
TF : 1.12
Python: 3.6.7
VS Code: 1.3 with: C#, Debugger for Unity, Unity Tools plugins.
.NET Frameworks: (perhaps I have too many of them)?
Project Settings:
I installed TFSharpPlugin (by double clicking it. And I keep it in a different folder than Unity if it made any difference... i'm becoming paranoid.. :))
I confirmed to have this issue on both of my projects (started new, clean one as well)
Any suggestions would be greatly appreciated. Thanks!
The text was updated successfully, but these errors were encountered: