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

_pickle.UnpicklingError: Failed to interpret file '../checkpoint/checkpoint.npy' as a pickle #76

Open
nutsintheshell opened this issue Jan 26, 2024 · 2 comments

Comments

@nutsintheshell
Copy link

I try to evaluate tapir on robotap and davis dataset. however, I got the error:

Traceback (most recent call last):
  File "/home/jishengyin/anaconda3/envs/tapnet/lib/python3.10/site-packages/numpy/lib/npyio.py", line 467, in load
    return pickle.load(fid, **pickle_kwargs)
_pickle.UnpicklingError: invalid load key, '-'.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/jishengyin/newpan/tapnet/../experiment.py", line 431, in <module>
    app.run(main)
  File "/home/jishengyin/anaconda3/envs/tapnet/lib/python3.10/site-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/home/jishengyin/anaconda3/envs/tapnet/lib/python3.10/site-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
  File "/home/jishengyin/newpan/tapnet/../experiment.py", line 424, in main
    platform.main(
  File "/home/jishengyin/anaconda3/envs/tapnet/lib/python3.10/site-packages/jaxline/utils.py", line 531, in inner_wrapper
    return f(*args, **kwargs)
  File "/home/jishengyin/anaconda3/envs/tapnet/lib/python3.10/site-packages/jaxline/platform.py", line 137, in main
    train.evaluate(experiment_class, config, checkpointer, writer,
  File "/home/jishengyin/anaconda3/envs/tapnet/lib/python3.10/site-packages/jaxline/utils.py", line 662, in inner_wrapper
    return fn(*args, **kwargs)
  File "/home/jishengyin/anaconda3/envs/tapnet/lib/python3.10/site-packages/jaxline/train.py", line 243, in evaluate
    checkpointer.restore("latest")
  File "/home/jishengyin/newpan/tapnet/utils/experiment_utils.py", line 160, in restore
    ckpt_state = np.load(fp, allow_pickle=True).item()
  File "/home/jishengyin/anaconda3/envs/tapnet/lib/python3.10/site-packages/numpy/lib/npyio.py", line 469, in load
    raise pickle.UnpicklingError(
_pickle.UnpicklingError: Failed to interpret file <tensorflow.python.platform.gfile.GFile object at 0x7ff6917b3f70> as a pickle

then I found the error occurs at np.load(path/to/checkpoint_file, allow_pickle=True), the checkpoint file i use is download from readme. could you please solve the problem?

@Eric-Lee
Copy link

Did you find a solution? Running into the same error.

@nutsintheshell
Copy link
Author

Did you find a solution? Running into the same error.

I solved the error by changing a model.Notably, the model in readme is a tapnet baseline model, which has a different network structure with tapir model. Therefore, a tapir model in the official colab is needed in checkpoint path when inferencing tapir model.

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