Ml-agents: TFException Error When Building on MacBook Pro with High Sierra

Created on 1 Feb 2018  路  12Comments  路  Source: Unity-Technologies/ml-agents

I followed the instructions and successfully created a working brain (.byte file) and built a program using the 3DBall example. However, I'm having trouble getting the other examples to work. I'm able to create the .byte files for the other examples but not able to get the program to build or run in Editor. I get the error below. I start each new attempt with a clean download and reimport the TFSharpPlugin every time. I would appreciate help with this. Thanks in advance.

TFException: NodeDef mentions attr 'dilations' not in Op output:T; attr=T:type,allowed=[DT_HALF, DT_FLOAT]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]>; NodeDef: conv2d/Conv2D = Conv2DT=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="VALID", strides=[1, 4, 4, 1], use_cudnn_on_gpu=true. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
TensorFlow.TFStatus.CheckMaybeRaise (TensorFlow.TFStatus incomingStatus, System.Boolean last) (at <6ed6db22f8874deba74ffe3e566039be>:0)
TensorFlow.TFGraph.Import (TensorFlow.TFBuffer graphDef, TensorFlow.TFImportGraphDefOptions options, TensorFlow.TFStatus status) (at <6ed6db22f8874deba74ffe3e566039be>:0)
TensorFlow.TFGraph.Import (System.Byte[] buffer, TensorFlow.TFImportGraphDefOptions options, TensorFlow.TFStatus status) (at <6ed6db22f8874deba74ffe3e566039be>:0)
TensorFlow.TFGraph.Import (System.Byte[] buffer, System.String prefix, TensorFlow.TFStatus status) (at <6ed6db22f8874deba74ffe3e566039be>:0)
CoreBrainInternal.InitializeCoreBrain () (at Assets/ML-Agents/Scripts/CoreBrainInternal.cs:112)
Brain.InitializeBrain () (at Assets/ML-Agents/Scripts/Brain.cs:187)
Academy.Awake () (at Assets/ML-Agents/Scripts/Academy.cs:124)

help-wanted needs-info

Most helpful comment

I figured out the problem! Actually, I failed to solve the problem because I downgraded TensorFlow in a different directory (which was C:\Users\MyName, so it did install TensorFlow 1.4 but didn't work obviously because the TensorFlow I will be using in Jupyter Notebook was installed in 'Anaconda3' folder). So, I tried to downgrade the TensorFlow in the C:\Users\MyName\Anaconda3 (which is where I installed TensorFlow previously) and now it's working!

All 12 comments

Hey,
What environment is this ? Is it the grid world ?
Which version of Tensorflow are you using to generate the .bytes file?
Was this trained using our implementation of PPO ?
Thanks you !

I tried the grid world and wall (in Area) examples and got the same error. I tried Reacher and didn't get the error but arms didn't move when I built it. I also tried a tutorial byJson from Unity3d College using the PPO on GitHub and got the same error.
I'm using Python 2.7.14 and Tensorflow 1.5.0.
Yes on the PPO.
I appreciate your help!

Can you try with tensorflow r1.4 instead of r1.5? The version of TensorflowSharp we use is not up to date.

I downgraded to r1.4 and was able to resolve the issue with the error. However, now I have a new issue. I can't build to iOS (using Xcode 9.2). I get a "clang: error: no such file or direction: 'Accelerate' even though I add the Accelerate framework when in Xcode (and add the library in the other linker flag). If I can't resolve, I will start another thread for that issue so everyone can find it.
Thanks again for your help.

My environment:

  • Windows 10
  • Tensorflow 1.4.0 (I used 1.5 but then I tried to downgrade to see if it solves but this didn't work)
  • Python 3.5
  • Unity (probably the newest version)

I got exactly the same problem with this error message. The example I used was also the exact same one:
Creating a custom Unity3D Machine Learning Agent, by Json, from Unity 3d College.
(https://www.youtube.com/watch?v=61_FtB1PhaM)

Everything was successful until I put the .byte file in the Graph Model, but when I played the Unity game, it gave me the error message like this. This is the error message I got from Unity:

TFException: NodeDef mentions attr 'output_dtype' not in Op output:int64; attr=seed:int,default=0; attr=seed2:int,default=0; attr=T:type,allowed=[DT_FLOAT, DT_DOUBLE, DT_INT32, DT_INT64, DT_UINT8, DT_INT16, DT_INT8, DT_UINT16, DT_HALF]; is_stateful=true>; NodeDef: multinomial/Multinomial = MultinomialT=DT_FLOAT, output_dtype=DT_INT64, seed=0, seed2=0. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
TensorFlow.TFStatus.CheckMaybeRaise (TensorFlow.TFStatus incomingStatus, System.Boolean last) (at <6ed6db22f8874deba74ffe3e566039be>:0)
TensorFlow.TFGraph.Import (TensorFlow.TFBuffer graphDef, TensorFlow.TFImportGraphDefOptions options, TensorFlow.TFStatus status) (at <6ed6db22f8874deba74ffe3e566039be>:0)
TensorFlow.TFGraph.Import (System.Byte[] buffer, TensorFlow.TFImportGraphDefOptions options, TensorFlow.TFStatus status) (at <6ed6db22f8874deba74ffe3e566039be>:0)
TensorFlow.TFGraph.Import (System.Byte[] buffer, System.String prefix, TensorFlow.TFStatus status) (at <6ed6db22f8874deba74ffe3e566039be>:0)
CoreBrainInternal.InitializeCoreBrain () (at Assets/ML-Agents/Scripts/CoreBrainInternal.cs:112)
Brain.InitializeBrain () (at Assets/ML-Agents/Scripts/Brain.cs:187)
Academy.Awake () (at Assets/ML-Agents/Scripts/Academy.cs:124)

After downgrading to Tensorflow 1.4.0, I went back and tried to play the project that I built following Json's tutorial. I got the same error as you did. I started with the unity environment and python files from Github and added the Json's script, etc. to that. I'm going to tinker with it some more and will update if I figure out a cause.

I figured out the problem! Actually, I failed to solve the problem because I downgraded TensorFlow in a different directory (which was C:\Users\MyName, so it did install TensorFlow 1.4 but didn't work obviously because the TensorFlow I will be using in Jupyter Notebook was installed in 'Anaconda3' folder). So, I tried to downgrade the TensorFlow in the C:\Users\MyName\Anaconda3 (which is where I installed TensorFlow previously) and now it's working!

Hi, BeskaMilk. Can you please tell me how to do it exactly? i found that every time i install the TF1.4 , it's going to C:\users\name.

@billluky are you still running into issues?

@mmattar Thank you, I think he already solved the problem. We are classmates :)

Confirming solution on windows as well, was getting the same issue with:
TFException: NodeDef mentions attr 'dilations' not in Op ....

Changed to tensorflow v1.4
Remade graph and it worked

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rodnyy picture Rodnyy  路  3Comments

tensorgpu picture tensorgpu  路  3Comments

Hongsungchan picture Hongsungchan  路  3Comments

MrGitGo picture MrGitGo  路  4Comments

gerardsimons picture gerardsimons  路  3Comments