Closed buqing2009 closed 4 years ago
Encountering the same problem from today but this was not the case a week back. Here's the Colab Notebook for reproducing the issue.
@winnietsang recompiled 6c1213e, and now fixed! Thank you!
@buqing2009 could you elaborate on how you fixed it up?
I installed onnx-tf
like the following:
!git clone https://github.com/onnx/onnx-tensorflow
!pip install onnx
%cd onnx-tensorflow
!git checkout 6c1213ed5628111d03bdb58f61fe941357ec18cf # To reflect the fix
!pip install -e .
The !
is there because I am running from a Colab Notebook. Here's my Colab Notebook that can reproduce this issue.
Any pointers?
Cc: @winnietsang
@sayakpaul please checkout my PR #687 before convert your model.
@winnietsang tried this, thank you. It now results into TypeError: can't multiply sequence by non-int of type 'Tensor'
.
Here's the Colab Notebook to reproduce this issue.
@sayakpaul PR #687 should fix the TypeError you show above.
2020-09-29 14:37:06,027 - onnx-tf - INFO - Start converting onnx pb to tf pb: WARNING:tensorflow:From c:\users\88000024\onnx-tensorflow\onnx_tf\backend.py:124: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
2020-09-29 14:37:07.160249: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-09-29 14:37:07.170141: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2020-09-29 14:37:07.174680: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)
2020-09-29 14:37:07.188364: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: NS88000024
2020-09-29 14:37:07.195368: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: NS88000024
WARNING:tensorflow:From c:\users\88000024\onnx-tensorflow\onnx_tf\handlers\backend\reshape.py:26: where (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
WARNING:tensorflow:From c:\users\88000024\onnx-tensorflow\onnx_tf\handlers\backend\reshape.py:31: sparse_to_dense (from tensorflow.python.ops.sparse_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Create a tf.sparse.SparseTensor
and use tf.sparse.to_dense
instead.
WARNING:tensorflow:From c:\users\88000024\onnx-tensorflow\onnx_tf\handlers\backend\gemm.py:14: flatten (from tensorflow.python.layers.core) is deprecated and will be removed in a future version.
Instructions for updating:
Use keras.layers.flatten instead.
WARNING:tensorflow:From D:\setup\Anaconda3\envs\test_py361\lib\site-packages\tensorflow_core\python\layers\core.py:332: Layer.apply (from tensorflow.python.keras.engine.base_layer) is deprecated and will be removed in a future version.
Instructions for updating:
Please use layer.__call__
method instead.
WARNING:tensorflow:From c:\users\88000024\onnx-tensorflow\onnx_tf\handlers\backend\dilated_pooling.py:640: The name tf.nn.max_pool_v2 is deprecated. Please use tf.nn.max_pool instead.
Traceback (most recent call last):
File "D:\setup\Anaconda3\envs\test_py361\lib\site-packages\tensorflow_core\python\framework\tensor_util.py", line 541, in make_tensor_proto
str_values = [compat.as_bytes(x) for x in proto_values]
File "D:\setup\Anaconda3\envs\test_py361\lib\site-packages\tensorflow_core\python\framework\tensor_util.py", line 541, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\setup\Anaconda3\envs\test_py361\Scripts\onnx-tf-script.py", line 33, in
same problem. how to fix it?please here is my test model: https://github.com/ouyanghuiyu/chineseocr_lite/blob/onnx/models/crnn_lite_lstm.onnx
@amandazw the dynamic shape for the early version of slice handler is fixed in the PR, https://github.com/onnx/onnx-tensorflow/pull/776. Feel free to check it out.
Describe the bug
I convert my pytorch model to onnx, and the precision of result has been tested. Now i convert the onnx to tensorflow using onnx-tf, it return error code:
TypeError: Failed to convert object of type <class 'list'> to Tensor. Contents: [1, None, 1, 1]. Consider casting elements to a supported type.
To Reproduce The details as below:
But there is no list type in my onnx model, so how did this error occur?
ONNX model file
downlowd model
Python, ONNX, ONNX-TF, Tensorflow version
This section can be obtained by running
get_version.py
from util folder.Additional context
Add any other context about the problem here.