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

The GPD model can not be loaded #5

Open
JUNZHU-SEIS opened this issue Oct 19, 2021 · 2 comments
Open

The GPD model can not be loaded #5

JUNZHU-SEIS opened this issue Oct 19, 2021 · 2 comments

Comments

@JUNZHU-SEIS
Copy link

Script

python gpd_predict.py -V -I anza2016.in -O anza2016.out

Error message

2021-10-19 10:06:32.133010: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.1
Traceback (most recent call last):
  File "/home/as/Work/tmp/MultiPhasePickerTest/code/generalized-phase-detection/gpd_predict.py", line 165, in <module>
    model = model_from_json(loaded_model_json, custom_objects={'tf':tf})
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/saving/model_config.py", line 131, in model_from_json
    return deserialize(config, custom_objects=custom_objects)
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/layers/serialization.py", line 173, in deserialize
    return generic_utils.deserialize_keras_object(
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 354, in deserialize_keras_object
    return cls.from_config(
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/engine/training.py", line 2261, in from_config
    return functional.Functional.from_config(
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/engine/functional.py", line 668, in from_config
    input_tensors, output_tensors, created_layers = reconstruct_from_config(
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/engine/functional.py", line 1275, in reconstruct_from_config
    process_layer(layer_data)
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/engine/functional.py", line 1257, in process_layer
    layer = deserialize_layer(layer_data, custom_objects=custom_objects)
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/layers/serialization.py", line 173, in deserialize
    return generic_utils.deserialize_keras_object(
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 354, in deserialize_keras_object
    return cls.from_config(
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/layers/core.py", line 1019, in from_config
    function = cls._parse_function_from_config(
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/layers/core.py", line 1071, in _parse_function_from_config
    function = generic_utils.func_load(
  File "/home/as/anaconda3/envs/tf_gpu/lib/python3.9/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 457, in func_load
    code = marshal.loads(raw_code)
ValueError: bad marshal data (unknown type code)

My environment

keras=2.4.3
python=3.9.6
tensorflow=2.4.1

Any reply is appreciated.

@jamm1985
Copy link

@JUNZHU-SEIS please check that #4

@jamm1985
Copy link

jamm1985 commented Nov 6, 2021

In https://github.com/jamm1985/seismo-performer we redeployed original GPD model to tf 2.5.0. So it works by several lines of code.

/cc @JUNZHU-SEIS

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

2 participants