tfjs icon indicating copy to clipboard operation
tfjs copied to clipboard

ValueError: Unsupported Ops in the model before optimization Dilation2D

Open jdariasl opened this issue 6 years ago • 2 comments

Hi

I'm trying to convert a frozen model using tensorflowjs_converter but I got this error:

Traceback (most recent call last): File "/home/julian/.local/bin/tensorflowjs_converter", line 8, in sys.exit(pip_main()) File "/home/julian/.local/lib/python3.7/site-packages/tensorflowjs/converters/converter.py", line 671, in pip_main main([' '.join(sys.argv[1:])]) File "/home/julian/.local/lib/python3.7/site-packages/tensorflowjs/converters/converter.py", line 675, in main convert(argv[0].split(' ')) File "/home/julian/.local/lib/python3.7/site-packages/tensorflowjs/converters/converter.py", line 658, in convert weight_shard_size_bytes=weight_shard_size_bytes) File "/home/julian/.local/lib/python3.7/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 395, in convert_tf_frozen_model weight_shard_size_bytes=weight_shard_size_bytes) File "/home/julian/.local/lib/python3.7/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 144, in optimize_graph ', '.join(unsupported)) ValueError: Unsupported Ops in the model before optimization Dilation2D

My environment:

tensorflowjs 1.7.2 tensorflow 2.1.0

jdariasl avatar Apr 05 '20 01:04 jdariasl

Same problem here:

Uncaught (in promise) TypeError: Unknown op 'Dilation2D'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()

Model trained on Pytorch, converted to ONNX then to TF then TFJS/JSON. It works on ONNXJS for CPU, but doesn't on ONNXJS with WEBGL backend. I wanted to give TFJS a try but I'm stuck at this error. If it can't be fixed, how should I retrain my model ? Note that tensorflowjs_converter did warn me that Dilation2D was unsupported but I used the skip_op_check flag. If you need a model using this op, I can share it.

edit: maybe it's linked with the maxpooling layer?.

tfjs 1.7.2 tf 2.1.0

Whiax avatar Apr 20 '20 11:04 Whiax

I am facing the same problem. Could you please suggest a work around till a fix is released. Thank you.

ai-bites avatar May 14 '20 10:05 ai-bites