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

error to load the pre-trained model. ValueError: bad marshal data (unknown type code) #16

Open
richa10 opened this issue Jan 17, 2023 · 0 comments

Comments

@richa10
Copy link

richa10 commented Jan 17, 2023

Hi team,

i am trying to execute your code to infer using the latest version of keras = 2.11.0 and tensorflow = 2.11.0 on macos m1. I am getting the below error as :

I0117 21:46:24.816843 8674884224 infer_liver_ideal_multiecho.py:263] loading from trained_models/liver_ideal/20191002_withphase_low_liver_2d_ideal.h5
Traceback (most recent call last):
File "/Volumes/Data/UKB_data_sample/ukbb-mri-sseg-master/public_sseg/infer_liver_ideal_multiecho.py", line 393, in
app.run(main)
File "/opt/homebrew/lib/python3.10/site-packages/absl/app.py", line 308, in run
_run_main(main, args)
File "/opt/homebrew/lib/python3.10/site-packages/absl/app.py", line 254, in _run_main
sys.exit(main(argv))
File "/Volumes/Data/UKB_data_sample/ukbb-mri-sseg-master/public_sseg/infer_liver_ideal_multiecho.py", line 264, in main
model = load_model(model_fullpath, custom_objects={'loss_sseg': loss_sseg, 'dice2_loss': dice2_loss})
File "/opt/homebrew/lib/python3.10/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/opt/homebrew/lib/python3.10/site-packages/keras/utils/generic_utils.py", line 103, in func_load
code = marshal.loads(raw_code)
ValueError: bad marshal data (unknown type code)

I am aware that this code is developed on tensorflow 1.14 or 1.15. is there any way around to get the support to run using the latest version of tensorflow or keras. I believe the main problem is to load the pre-trained model itself.

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

1 participant