PSPNet-Keras-tensorflow icon indicating copy to clipboard operation
PSPNet-Keras-tensorflow copied to clipboard

SystemError: unknown opcode

Open ybxbupt opened this issue 6 years ago • 8 comments

Namespace(flip=True, glob_path=None, id='0', input_path='example_images/cityscapes.png', input_size=500, model='pspnet50_ade20k', output_path='example_results/cityscapes.jpg', weights=None) weights/keras/pspnet50_ade20k.json Keras model & weights found, loading... XXX lineno: 18, opcode: 0 Traceback (most recent call last): File "/home/jiurui/temp/PSPNet-Keras-tensorflow-master/pspnet.py", line 186, in weights=args.model) File "/home/jiurui/temp/PSPNet-Keras-tensorflow-master/pspnet.py", line 133, in init input_shape=input_shape, weights=weights) File "/home/jiurui/temp/PSPNet-Keras-tensorflow-master/pspnet.py", line 34, in init self.model = model_from_json(file_handle.read()) File "/home/jiurui/env_mask_rcnn/lib/python3.6/site-packages/keras/models.py", line 345, in model_from_json return layer_module.deserialize(config, custom_objects=custom_objects) File "/home/jiurui/env_mask_rcnn/lib/python3.6/site-packages/keras/layers/init.py", line 54, in deserialize printable_module_name='layer') File "/home/jiurui/env_mask_rcnn/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 139, in deserialize_keras_object list(custom_objects.items()))) File "/home/jiurui/env_mask_rcnn/lib/python3.6/site-packages/keras/engine/topology.py", line 2497, in from_config process_node(layer, node_data) File "/home/jiurui/env_mask_rcnn/lib/python3.6/site-packages/keras/engine/topology.py", line 2454, in process_node layer(input_tensors[0], **kwargs) File "/home/jiurui/env_mask_rcnn/lib/python3.6/site-packages/keras/engine/topology.py", line 602, in call output = self.call(inputs, **kwargs) File "/home/jiurui/env_mask_rcnn/lib/python3.6/site-packages/keras/layers/core.py", line 650, in call return self.function(inputs, **arguments) File "/media/tatsch/DataSSD1/workspace/PSPNet-Keras-tensorflow/pspnet/layers_builder.py", line 18, in Interp return BatchNormalization(momentum=0.95, name=name, epsilon=1e-5) SystemError: unknown opcode

ybxbupt avatar Nov 13 '18 02:11 ybxbupt

I have this error too. I am on CentosOS with keras 2.0.6, tensorflow 1.11, and python 3.6

ktnguyen2 avatar Nov 14 '18 17:11 ktnguyen2

I also encounter this error, has anyone found out what goes wrong yet? Could it be a Python / TF / Keras version error?

anieuwland avatar Jan 18 '19 14:01 anieuwland

I have this error too. Anyone solved this yet?

hwchen2009 avatar Feb 08 '19 20:02 hwchen2009

I fixed it by using python 3.5. Both 2.7 and 3.6 didn't work for me.

anieuwland avatar Feb 08 '19 21:02 anieuwland

I also fixed it by using python 3.5

ktnguyen2 avatar Feb 11 '19 00:02 ktnguyen2

Thanks! that worked

hwchen2009 avatar Feb 11 '19 14:02 hwchen2009

Trying dig info how to workaround to deal with this on Python3.6+

Currently found, which states that this is Keras/TF/Theano error when loading .h5 models with Python 3.6+: https://github.com/keras-team/keras/issues/9595 But WIP

Vladkryvoruchko avatar Sep 23 '19 09:09 Vladkryvoruchko

Okay, found old discussion here: https://github.com/Vladkryvoruchko/PSPNet-Keras-tensorflow/issues/25#issuecomment-373985500

Apparently this issue is caused by the marshal serial format having changed a bit between Python 3.5 and 3.6 as discovered in keras-team/keras#9595 . Converting the weights from numpy with python 3.6 should work around it.

Vladkryvoruchko avatar Sep 23 '19 09:09 Vladkryvoruchko