t_wの輪郭

Feedlyでフォローするボタン
NeRFPythonが嫌いWSLでNeRFの環境を構築するWSL

WSLでNeRFを動かす

2023/5/6 12:56:00

前提

Windows11にWSLとしてUbuntu22.04が入っているものとする
WSLでNeRFの環境を構築するに従って、環境構築済みであるものとする

QuickStartを動かす手順

QuickStart: https://github.com/bmild/nerf#tldr-quickstart

Linux Shellでプロジェクトディレクトリを開く
bash download_example_data.shを実行
python run_nerf.py --config config_fern.txtを実行
→エラー!!!!これだからPythonは嫌いなんだよ!!!!
python run_nerf.py --config config_fern.txt実行時のエラーを直す
python run_nerf.py --config config_fern.txtを再度実行
tensorboard --logdir=logs/summaries --port=6006を実行

python run_nerf.py --config config_fern.txt実行時のエラー
Traceback (most recent call last):
  File "run_nerf.py", line 928, in <module>
    train()
  File "run_nerf.py", line 590, in train
    spherify=args.spherify)
  File "/mnt/c/Users/tzmtw/Downloads/nerf-master/nerf-master/load_llff.py", line 246, in load_llff_data
    poses, bds, imgs = _load_data(basedir, factor=factor) # factor=8 downsamples original imgs by 8x
  File "/mnt/c/Users/tzmtw/Downloads/nerf-master/nerf-master/load_llff.py", line 114, in _load_data
    imgs = imgs = [imread(f)[...,:3]/255. for f in imgfiles]
  File "/mnt/c/Users/tzmtw/Downloads/nerf-master/nerf-master/load_llff.py", line 114, in <listcomp>
    imgs = imgs = [imread(f)[...,:3]/255. for f in imgfiles]
  File "/mnt/c/Users/tzmtw/Downloads/nerf-master/nerf-master/load_llff.py", line 110, in imread
    return imageio.imread(f, ignoregamma=True)
  File "/home/tzmtwtr/anaconda3/envs/nerf/lib/python3.7/site-packages/imageio/__init__.py", line 97, in imread
    return imread_v2(uri, format=format, **kwargs)
  File "/home/tzmtwtr/anaconda3/envs/nerf/lib/python3.7/site-packages/imageio/v2.py", line 349, in imread
    result = file.read(index=0, **kwargs)
TypeError: read() got an unexpected keyword argument 'ignoregamma'

暫定的対応

load_llff.pyの110行目の
return imageio.imread(f, ignoregamma=True)

return imageio.imread(f)
に書き換える