SizheAn / PanoHead

Code Repository for CVPR 2023 Paper "PanoHead: Geometry-Aware 3D Full-Head Synthesis in 360 degree"
Creative Commons Zero v1.0 Universal
1.91k stars 236 forks source link

cannot stat '/content/3DDFA_V2/crop_samples/img/*': No such file or directory #49

Open pivcec opened 7 months ago

pivcec commented 7 months ago

am trying to follow tutorial video and run colab from:

https://colab.research.google.com/github/camenduru/PanoHead-colab/blob/main/PanoHead_custom_colab.ipynb#scrollTo=v9wpwlGfiX2e

after running second block of code, the following error is produced:

/content/3DDFA_V2
/content/3DDFA_V2/bfm/bfm.py:34: FutureWarning: In the future `np.long` will be defined as the corresponding NumPy scalar.
  self.keypoints = bfm.get('keypoints').astype(np.long)  # fix bug
Traceback (most recent call last):
  File "/content/3DDFA_V2/recrop_images.py", line 322, in <module>
    main(args)
  File "/content/3DDFA_V2/recrop_images.py", line 183, in main
    tddfa = TDDFA(gpu_mode=gpu_mode, **cfg)
  File "/content/3DDFA_V2/TDDFA.py", line 34, in __init__
    self.bfm = BFMModel(
  File "/content/3DDFA_V2/bfm/bfm.py", line 34, in __init__
    self.keypoints = bfm.get('keypoints').astype(np.long)  # fix bug
  File "/usr/local/lib/python3.10/dist-packages/numpy/__init__.py", line 328, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'long'. Did you mean: 'log'?
cp: cannot stat '/content/3DDFA_V2/crop_samples/img/*': No such file or directory
ramshamashood commented 6 months ago

I have same error need solution of this problem

BuTTerK3ks commented 6 months ago

On my local machine i installed numpy==1.23.5 which resolved the issue. numpy.long was removed in version 1.24.0

bobgus39 commented 4 months ago

It doesn't work with numpy==1.23.5 as well

Animus777 commented 4 months ago

It doesn't work with numpy==1.23.5 as well

I works for me with this version in Colab.

Yeadon8888 commented 2 months ago

I have run !pip install --force-reinstall numpy==1.23.5 but still bug when i run the second like this /content/3DDFA_V2 0% 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "/content/3DDFA_V2/recrop_images.py", line 322, in main(args) File "/content/3DDFA_V2/recrop_images.py", line 291, in main cv2.imwrite(os.path.join(args.out_dir, os.path.basename(img_path).replace(".png",".jpg")), cropped_img) cv2.error: OpenCV(4.8.0) /io/opencv/modules/imgcodecs/src/loadsave.cpp:787: error: (-215:Assertion failed) !_img.empty() in function 'imwrite'

cp: cannot stat '/content/3DDFA_V2/crop_samples/img/*': No such file or directory

Animus777 commented 2 months ago

I have run !pip install --force-reinstall numpy==1.23.5 but still bug when i run the second like this

You have to run it AFTER the first cell. Like this:

  1. Run first cell. Let it finish.
  2. run !pip install --force-reinstall numpy==1.23.5 (after finishing it'll ask you to restart runtime. Accept.)
  3. Run second cell (DO NOT run first one again.)