SystemError: unknown opcode when running the example
Open
ZeitgeberH
opened this issue 7 years ago
•
5 comments
I was trying to run the example described in the setup instructions:
CUDA_VISIBLE_DEVICES="0" python unet2ds_nf.py evaluate neurofinder.00.00 --model unet2ds_model.hdf5
The error is as follows:
/home/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
return f(*args, **kwds)
/home/anaconda3/lib/python3.6/site-packages/h5py/init.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
INFO:nf_load_hdf5:neurofinder.00.00 already downloaded.
INFO:nf_load_hdf5:Preparing hdf5 files for neurofinder.00.00.
INFO:evaluation:Evaluation with TTA.
XXX lineno: 167, opcode: 0
Traceback (most recent call last):
File "unet2ds_nf.py", line 147, in
f(**args)
File "unet2ds_nf.py", line 68, in evaluation
augmentation=aug, # Test-time augmentation.
File "/home/.local/lib/python3.6/site-packages/deepcalcium/models/neurons/unet_2d_summary.py", line 561, in predict
custom_objects=self.custom_objects)
File "/home/.local/lib/python3.6/site-packages/deepcalcium/utils/keras_helpers.py", line 66, in load_model_with_new_input_shape
model = load_model(path, **load_model_args)
File "/home/anaconda3/lib/python3.6/site-packages/keras/models.py", line 243, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "/home/anaconda3/lib/python3.6/site-packages/keras/models.py", line 317, in model_from_config
return layer_module.deserialize(config, custom_objects=custom_objects)
File "/home/anaconda3/lib/python3.6/site-packages/keras/layers/init.py", line 55, in deserialize
printable_module_name='layer')
File "/home/anaconda3/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 143, in deserialize_keras_object
list(custom_objects.items())))
File "/home/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 2517, in from_config
process_node(layer, node_data)
File "/home/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 2474, in process_node
layer(input_tensors[0], **kwargs)
File "/home/anaconda3/lib/python3.6/site-packages/keras/engine/topology.py", line 617, in call
output = self.call(inputs, **kwargs)
File "/home/anaconda3/lib/python3.6/site-packages/keras/layers/core.py", line 663, in call
return self.function(inputs, **arguments)
File "../deepcalcium/models/neurons/unet_2d_summary.py", line 167, in
SystemError: unknown opcode
@ZeitgeberH Any updates on this? It might be tough to get everything running under Anaconda, as the code uses several niche libraries which are probably not on condaforge.
I was trying to run:
CUDA_VISIBLE_DEVICES="0" python unet2ds_nf.py evaluate neurofinder.00.00 --model unet2ds_model.hdf5
(I don't have RuntimeWarning as last post)
The error is as follows:
$ CUDA_VISIBLE_DEVICES="0" python unet2ds_nf.py evaluate neurofinder.00.00 --model unet2ds_model.hdf5
D:\ProgramData\Anaconda3\lib\site-packages\h5py_init_.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as register_converters
Using TensorFlow backend.
INFO:nf_load_hdf5:neurofinder.00.00 already downloaded.
INFO:nf_load_hdf5:Preparing hdf5 files for neurofinder.00.00.
INFO:evaluation:Evaluation with TTA.
XXX lineno: 167, opcode: 0
Traceback (most recent call last):
File "unet2ds_nf.py", line 147, in
f(**args)
File "unet2ds_nf.py", line 68, in evaluation
augmentation=aug, # Test-time augmentation.
File "C:\Users\Deep\AppData\Roaming\Python\Python36\site-packages\deepcalcium\models\neurons\unet_2d_summary.py", line 561, in predict
custom_objects=self.custom_objects)
File "C:\Users\Deep\AppData\Roaming\Python\Python36\site-packages\deepcalcium\utils\keras_helpers.py", line 66, in load_model_with_new_input_shape
model = load_model(path, **load_model_args)
File "D:\ProgramData\Anaconda3\lib\site-packages\keras\models.py", line 243, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "D:\ProgramData\Anaconda3\lib\site-packages\keras\models.py", line 317, in model_from_config
return layer_module.deserialize(config, custom_objects=custom_objects)
File "D:\ProgramData\Anaconda3\lib\site-packages\keras\layers_init.py", line 55, in deserialize
printable_module_name='layer')
File "D:\ProgramData\Anaconda3\lib\site-packages\keras\utils\generic_utils.py", line 143, in deserialize_keras_object
list(custom_objects.items())))
File "D:\ProgramData\Anaconda3\lib\site-packages\keras\engine\topology.py", line 2517, in from_config
process_node(layer, node_data)
File "D:\ProgramData\Anaconda3\lib\site-packages\keras\engine\topology.py", line 2474, in process_node
layer(input_tensors[0], **kwargs)
File "D:\ProgramData\Anaconda3\lib\site-packages\keras\engine\topology.py", line 617, in call
output = self.call(inputs, **kwargs)
File "D:\ProgramData\Anaconda3\lib\site-packages\keras\layers\core.py", line 663, in call
return self.function(inputs, **arguments)
File "../deepcalcium/models/neurons/unet_2d_summary.py", line 167, in
SystemError: unknown opcode
From a cursory look, I think it's a problem with library versions for loading the network weights.
Some of the used are very sensitive to the Python version and versions of other libs. If you use the given requirements.txt file with Python 3.5 (not Conda), it should work.