kekeblom / StrayVisualizer

Visualize Data From Stray Scanner https://keke.dev/blog/2021/03/10/Stray-Scanner.html
MIT License
70 stars 13 forks source link

"Failed to interpret file %s as a pickle" #4

Closed jonasvonarb closed 2 years ago

jonasvonarb commented 3 years ago

Hei,

I am try to create a depth video from my lidarscan. I am using python 3.7.7 (otherwise i can't install open3d) and numpy 1.20.3

If I use the make_video.py I get the error:

Traceback (most recent call last):
  File "make_video.py", line 39, in <module>
    main()
  File "make_video.py", line 22, in main
    depth = np.load(path)
  File "/usr/local/lib/python3.7/site-packages/numpy/lib/npyio.py", line 445, in load
    raise ValueError("Cannot load file containing pickled data "
ValueError: Cannot load file containing pickled data when allow_pickle=False

So if I ad depth = np.load(path, allow_pickle=True) there is a new Error i don't quit get.

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/numpy/lib/npyio.py", line 448, in load
    return pickle.load(fid, **pickle_kwargs)
_pickle.UnpicklingError: invalid load key, '\x00'.

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

Traceback (most recent call last):
  File "make_video.py", line 39, in <module>
    main()
  File "make_video.py", line 22, in main
    depth = np.load(path, allow_pickle=True)
  File "/usr/local/lib/python3.7/site-packages/numpy/lib/npyio.py", line 451, in load
    "Failed to interpret file %s as a pickle" % repr(file)) from e
OSError: Failed to interpret file '/Users/jonasvonarb/Downloads/8a42b3d040/depth/.DS_Store' as a pickle

Do you have an Idea how to solve this?

kekeblom commented 3 years ago

It seems you are on mac and have a .DS_Store file in your directory which the code is trying to read. You can remove it and rerun the script. I'll update the code at some point to ignore files which are not depth maps.