tapnet icon indicating copy to clipboard operation
tapnet copied to clipboard

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

Open nutsintheshell opened this issue 1 year ago • 2 comments

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?

nutsintheshell avatar Jan 26 '24 04:01 nutsintheshell

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

Eric-Lee avatar Feb 20 '24 19:02 Eric-Lee

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.

nutsintheshell avatar Feb 25 '24 00:02 nutsintheshell

We weren't able to reproduce this error internally; I understand that the model should be loadable using the current instructions. I'm closing this, but feel free to reopen if similar errors are still a problem.

cdoersch avatar Aug 31 '24 15:08 cdoersch