-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Loading Model #145
Comments
i did use hdf5 format initially and they don't work for some reason. it look like the old problem was fixed and this one is a new problem with hdf5. For your last question, you can print out model summary using |
@zzh8829 Hi, thanks for your help. I was able to find the input dimensions of the model. I am trying to integrate this model into unity and I need either a frozen graph as a .pb file or an h5 file |
I believe either .tf or .h5 are for model (training) checkpoints. For your purpose SavedModel aka .pb format is more suitable. Please check out |
Hi, I would like to use the model with tfjs, should I convert to .h5 format first than use tfconverter to convert to browser format? which way do you recommend? |
any progress with this? trying to do the same (load the model in h5 format) to add one more input and output to the model |
I don't get the error when I export the model as .pb, but I get the error when I import the model:
|
We have:
And we map it like this:
If instead I replace
Then it just works but I understand this is not supposed to be like this, works for me as a workaround, but I would like to have a proper solution. Is somewhere the np.array transformed into a list? |
With that workaround I been able to deploy the model to my Raspberry pi, it loads the model fine, but when I try to to call
Looks like are 2 tensos: The 3 in there is probably because I'm using 3 custom classes. Any idea why this happens? |
I have saved the yolov3 tiny model into HDF5 format. However, when I try to load the model using keras load_model function I get this error.
Traceback (most recent call last):
File "Save_Model.py", line 40, in
new_model = keras.models.load_model('./savedmodel2/YOLO.h5')#tf.saved_model.load_model
File "C:\Users\sudes\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\keras\saving\save.py", line 146, in load_model
return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
File "C:\Users\sudes\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\keras\saving\hdf5_format.py", line 168, in load_model_from_hdf5
custom_objects=custom_objects)
File "C:\Users\sudes\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\keras\saving\model_config.py", line 55, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "C:\Users\sudes\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\keras\layers\serialization.py", line 102, in deserialize
printable_module_name='layer')
File "C:\Users\sudes\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\keras\utils\generic_utils.py", line 191, in deserialize_keras_object
list(custom_objects.items())))
File "C:\Users\sudes\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\keras\engine\network.py", line 906, in from_config
config, custom_objects)
File "C:\Users\sudes\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\keras\engine\network.py", line 1852, in reconstruct_from_config
process_node(layer, node_data)
File "C:\Users\sudes\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\keras\engine\network.py", line 1799, in process_node
output_tensors = layer(input_tensors, kwargs)
File "C:\Users\sudes\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\keras\engine\base_layer.py", line 842, in call
outputs = call_fn(cast_inputs, *args, kwargs)
File "C:\Users\sudes\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\keras\layers\core.py", line 795, in call
return self.function(inputs, arguments)
File "C:/Users/sudes/Documents/yolov3-tf2-master/yolov3-tf2-master/yolov3_tf2/models.py", line 252, in
boxes_0 = Lambda(lambda x: yolo_boxes(x, anchors[masks[0]], classes),
TypeError: list indices must be integers or slices, not list
How can I solve this problem? Is it something with the model itself or is something going wrong when saving in this specific format? I was able to get it to work in the TensorFlow saved model format. But I need it in an hdf5 file.
I also need to know what the shape of the input layer is to the yolov3 tiny model.
Thank you.
The text was updated successfully, but these errors were encountered: