Error when converting pretrained model: (raise ValueError("'%s' is not a valid scope name" % name) and 'functional_9/conv1/conv/Conv2D__6:0' is not a valid scope name #134
I tried to use the following code to change my onnx model to a keras model. I am using tensorflow version 2.1.0. My model is a densenet model that has been retrained for a new dataset. Let me know if additional information would be helpful. Thank you for your help!
#%% Load packages
import tensorflow as tf
import tf2onnx
import onnx
#%%
from onnx2keras import onnx_to_keras
#%% Load onnx model
onnx_model=onnx.load("Test_10_DC_R_Image.onnx")
#%% Convert to keras model
k_model = onnx_to_keras(onnx_model, input_names=['input'])
This is the error I recieved:
raise ValueError("'%s' is not a valid scope name" % name)
ValueError: 'functional_9/conv1/conv/Conv2D__6:0' is not a valid scope name
I tried to use the following code to change my onnx model to a keras model. I am using tensorflow version 2.1.0. My model is a densenet model that has been retrained for a new dataset. Let me know if additional information would be helpful. Thank you for your help!
This is the error I recieved: