ashawkey / RAD-NeRF

Real-time Neural Radiance Talking Portrait Synthesis via Audio-spatial Decomposition
MIT License
878 stars 153 forks source link

NoneType' object is not subscriptable #9

Open pegahs1993 opened 1 year ago

pegahs1993 commented 1 year ago

Thanks for this great work! After I run python data_utils/process.py data/obama/obama.mp4, I faced this error:

ImportError: cannot import name 'PILLOW_VERSION' from 'PIL' (/usr/local/lib/python3.7/site-packages/PIL/__init__.py)
[INFO] ===== extracted semantics =====
[INFO] ===== extract background image from data/obama/ori_imgs =====
  0% 0/400 [00:00<?, ?it/s][ WARN:0@47.667] global loadsave.cpp:244 findDecoder imread_('data/obama/parsing/5583.png'): can't open/read file: check file path/integrity
  0% 0/400 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "data_utils/process.py", line 385, in <module>
    extract_background(base_dir, ori_imgs_dir)
  File "data_utils/process.py", line 81, in extract_background
    bg = (parse_img[..., 0] == 255) & (parse_img[..., 1] == 255) & (parse_img[..., 2] == 255)
TypeError: 'NoneType' object is not subscriptable

Is there a solution to this problem?

ashawkey commented 1 year ago

@tylersky1993 It seems the semantic parsings are not successfully saved, could you try to upgrade PIL and try again?

pegahs1993 commented 1 year ago

@tylersky1993 It seems the semantic parsings are not successfully saved, could you try to upgrade PIL and try again?

Looks like downgrading to pillow 6.1 helps.

pip uninstall pillow conda install pillow==6.1

after this the error is gone.

iboyles commented 1 year ago

My colab always times out on task 8 with the same error even after doing this pillow command and it's done it before without issue.

[INFO] ===== perform face tracking ===== [INFO] fitting focal length... 600 2.854215145111084 -2.9494853019714355 700 2.8245153427124023 -3.4252140522003174 800 2.8225221633911133 -3.954467535018921 900 2.8104653358459473 -4.449606418609619 1000 2.7898242473602295 -4.8842387199401855 1100 2.794638156890869 -5.431201934814453 1200 2.795783281326294 -5.966848373413086 1300 2.7799265384674072 -6.391071319580078 1400 2.784719944000244 -6.941020488739014 [INFO] find best focal: 1300 [INFO] coarse fitting... 2.835364580154419 -6.839099407196045 [INFO] fitting light... [INFO] fine frame-wise fitting... 0 of 94 done 1 of 94 done 2 of 94 done 3 of 94 done 4 of 94 done 5 of 94 done 6 of 94 done 7 of 94 done 8 of 94 done 9 of 94 done 10 of 94 done 11 of 94 done 12 of 94 done 13 of 94 done 14 of 94 done 15 of 94 done 16 of 94 done 17 of 94 done 18 of 94 done 19 of 94 done 20 of 94 done 21 of 94 done 22 of 94 done 23 of 94 done 24 of 94 done 25 of 94 done 26 of 94 done 27 of 94 done 28 of 94 done 29 of 94 done 30 of 94 done 31 of 94 done 32 of 94 done 33 of 94 done 34 of 94 done 35 of 94 done 36 of 94 done 37 of 94 done 38 of 94 done 39 of 94 done 40 of 94 done 41 of 94 done 42 of 94 done 43 of 94 done 44 of 94 done 45 of 94 done 46 of 94 done 47 of 94 done 48 of 94 done 49 of 94 done 50 of 94 done 51 of 94 done 52 of 94 done 53 of 94 done 54 of 94 done 55 of 94 done 56 of 94 done 57 of 94 done 58 of 94 done 59 of 94 done 60 of 94 done 61 of 94 done 62 of 94 done 63 of 94 done 64 of 94 done 65 of 94 done 66 of 94 done 67 of 94 done 68 of 94 done 69 of 94 done [ WARN:0@12318.180] global loadsave.cpp:244 findDecoder imread_('data/ian2/ori_imgs/4480.jpg'): can't open/read file: check file path/integrity Traceback (most recent call last): File "/content/drive/MyDrive/RAD-NeRF/data_utils/face_tracking/face_tracker.py", line 272, in imgs.append(cv2.imread(img_paths[sel_id])[:, :, ::-1]) TypeError: 'NoneType' object is not subscriptable [INFO] ===== finished face tracking =====

hanak3 commented 1 month ago

Excuse me, can I ask for version of python did you use?