ml-agents icon indicating copy to clipboard operation
ml-agents copied to clipboard

TFException Error When Building on MacBook Pro with High Sierra

Open 3DAPPG2018 opened this issue 8 years ago • 12 comments

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<name=Conv2D; signature=input:T, filter:T -> 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 = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="VALID", strides=[1, 4, 4, 1], use_cudnn_on_gpu=true](observation_0, conv2d/kernel/read). (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)

3DAPPG2018 avatar Feb 01 '18 22:02 3DAPPG2018

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 !

vincentpierre avatar Feb 01 '18 22:02 vincentpierre

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!

3DAPPG2018 avatar Feb 01 '18 22:02 3DAPPG2018

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

vincentpierre avatar Feb 02 '18 18:02 vincentpierre

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.

3DAPPG2018 avatar Feb 03 '18 01:02 3DAPPG2018

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<name=Multinomial; signature=logits:T, num_samples:int32 -> 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 = Multinomial[T=DT_FLOAT, output_dtype=DT_INT64, seed=0, seed2=0](dense_3/MatMul, multinomial/Multinomial/num_samples). (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)

BeskaMilk avatar Feb 03 '18 14:02 BeskaMilk

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.

3DAPPG2018 avatar Feb 04 '18 00:02 3DAPPG2018

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!

BeskaMilk avatar Feb 04 '18 19:02 BeskaMilk

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 avatar Feb 12 '18 20:02 billluky

@billluky are you still running into issues?

mmattar avatar Apr 11 '18 21:04 mmattar

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

BeskaMilk avatar Apr 15 '18 18:04 BeskaMilk

Confirming solution on windows as well, was getting the same issue with: TFException: NodeDef mentions attr 'dilations' not in Op<name=Conv2DTranspose; signature=input:T, filter:T -> ....

Changed to tensorflow v1.4 Remade graph and it worked

pearsonkyle avatar Mar 28 '19 16:03 pearsonkyle

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.

lock[bot] avatar Mar 27 '20 17:03 lock[bot]