Skip to content
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

SystemError: unknown opcode #49

Open
ybxbupt opened this issue Nov 13, 2018 · 8 comments
Open

SystemError: unknown opcode #49

ybxbupt opened this issue Nov 13, 2018 · 8 comments

Comments

@ybxbupt
Copy link

ybxbupt commented Nov 13, 2018

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

@ktnguyen2
Copy link

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

@anieuwland
Copy link

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

@hwchen2009
Copy link

I have this error too. Anyone solved this yet?

@anieuwland
Copy link

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

@ktnguyen2
Copy link

I also fixed it by using python 3.5

@hwchen2009
Copy link

Thanks! that worked

@Vladkryvoruchko
Copy link
Owner

Vladkryvoruchko commented Sep 23, 2019

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+:
keras-team/keras#9595
But WIP

@Vladkryvoruchko
Copy link
Owner

Vladkryvoruchko commented Sep 23, 2019

Okay, found old discussion here:
#25 (comment)

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants