Closed weizhuang-93 closed 5 years ago
@weizhuang-93 any reason why are you doing Batch normalisation on axis=1? Typically it should be feature axis (-1) and we support only this case.
sorry for the very late reply, i was busy with other things. i changed the model to axis = -1 and the problem still exists
below are my files, .pb, .h5, .bytes(converted from tf, instead of .pb i use .bytes) and .pbtxt CNN_8k_2Conv2Dense_64_16.zip
Same error using axis(-1):
(ml-agents) C:\Users\Wei Zhuang>python ./ml-agents/ml-agents/mlagents/trainers/tensorflow_to_barracuda.py D:\MasterArbeit\05_Programm_und_Code\model\CNN_8k_2Conv2Dense_64_16.pb CNN_8k_2Conv2Dense_64_16.nn Converting D:\MasterArbeit\05_Programm_und_Code\model\CNN_8k_2Conv2Dense_64_16.pb to CNN_8k_2Conv2Dense_64_16.nn Sorting model, may take a while... Done! IGNORED: PlaceholderWithDefault unknown layer IGNORED: Switch unknown layer WARNING: rank unknown for tensor batch_normalization/cond/Switch:1 while processing node batch_normalization/cond/switch_t Traceback (most recent call last): File "./ml-agents/ml-agents/mlagents/trainers/tensorflow_to_barracuda.py", line 26, in <module> tf2bc.convert(args.source_file, args.target_file, args.trim_unused_by_output, args) File "C:\Users\Wei Zhuang\ml-agents\ml-agents\mlagents\trainers\tensorflow_to_barracuda.py", line 1552, in convert i_model, args File "C:\Users\Wei Zhuang\ml-agents\ml-agents\mlagents\trainers\tensorflow_to_barracuda.py", line 1397, in process_model process_layer(node, o_context, args) File "C:\Users\Wei Zhuang\ml-agents\ml-agents\mlagents\trainers\tensorflow_to_barracuda.py", line 1150, in process_layer for x in tensor_names File "C:\Users\Wei Zhuang\ml-agents\ml-agents\mlagents\trainers\tensorflow_to_barracuda.py", line 1150, in <listcomp> for x in tensor_names File "C:\Users\Wei Zhuang\ml-agents\ml-agents\mlagents\trainers\tensorflow_to_barracuda.py", line 697, in get_tensor_data return np.array(data).reshape(dims) UnboundLocalError: local variable 'data' referenced before assignment
in case it could help, i tried the keras to Barracuda conversiona and get the following error:
Converting .\CNN_8k_2Conv2Dense_64_16\CNN_8k_2Conv2Dense_64_16.h5 to CNN_8k_2Conv2Dense_64_16.bytes IN: '': [None, 40, 65, 1] => 'state' OUT: 'action' Traceback (most recent call last): File ".\barracuda-release-release-0.2.4\Tools\keras_to_barracuda.py", line 21, in <module> keras2bc.convert(args.source_file, args.target_file, args.trim_unused_by_output, args) File "C:\Users\Wei Zhuang\barracuda-release-release-0.2.4\Tools\keras_to_barracuda.py", line 421, in convert barracuda.write(o_model, target_file) File "C:\Users\Wei Zhuang\barracuda-release-release-0.2.4\Tools\barracuda.py", line 499, in write w.write_int32(l.axis) File "C:\Users\Wei Zhuang\barracuda-release-release-0.2.4\Tools\barracuda.py", line 447, in write_int32 self.f.write(struct.pack('<i', d)) struct.error: required argument is not an integer
This issue has been automatically marked as stale because it has not had activity in the last 14 days. It will be closed in the next 14 days if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 28 days. If this issue is still valid, please ping a maintainer. Thank you for your contributions.
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 would like to use tensorflow trained model for audio source separation in unity. I am trying to convert the model into NN Model with Barracuda but i seems to get error. i tried Onnx to Barracuda, Keras to Barracuda, and Tensorflow to Barracuda but none seems to work. I named my single input and single output.
I really hope someone could help me on this!!
I used: tensorflow-gpu=1.7.1 windows 10 ml-agents0.9.2 python 3.6.9 protobuf 3.9.1
Convert to h5 to protobuf with the following code:
the model i trained with following code:
is there any problem with my code because i am not sure why i can't convert the model
my model: output.zip