直接运行会报错:TypeError: PillowPlugin.read() got an unexpected keyword argument 'ignoregamma'
Closed this issue · 2 comments
User
/usr/local/lib/python3.10/dist-packages/torch/init.py:614: UserWarning: torch.set_default_tensor_type() is deprecated as of PyTorch 2.1, please use torch.set_default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at ../torch/csrc/tensor/python_tensor.cpp:451.)
_C._set_default_tensor_type(t)
Traceback (most recent call last):
File "/content/Deblur-NeRF/run_nerf.py", line 650, in
train()
File "/content/Deblur-NeRF/run_nerf.py", line 228, in train
images, poses, bds, render_poses, i_test = load_llff_data(args, args.datadir, args.factor,
File "/content/Deblur-NeRF/load_llff.py", line 242, in load_llff_data
poses, bds, imgs = _load_data(basedir, factor=factor) # factor=8 downsamples original imgs by 8x
File "/content/Deblur-NeRF/load_llff.py", line 102, in _load_data
imgs = imgs = [imread(f)[..., :3] / 255. for f in imgfiles]
File "/content/Deblur-NeRF/load_llff.py", line 102, in
imgs = imgs = [imread(f)[..., :3] / 255. for f in imgfiles]
File "/content/Deblur-NeRF/load_llff.py", line 98, in imread
return imageio.imread(f, ignoregamma=True)
File "/usr/local/lib/python3.10/dist-packages/imageio/init.py", line 97, in imread
return imread_v2(uri, format=format, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/imageio/v2.py", line 360, in imread
result = file.read(index=0, **kwargs)
TypeError: PillowPlugin.read() got an unexpected keyword argument 'ignoregamma'
问题可能出在 load_llff.py 文件中的 imread 函数调用上。根据错误信息中的提示,似乎是 PillowPlugin.read() 函数不支持 ignoregamma 这个关键字参数。
这可能是因为你使用了一个不兼容的参数,导致了 PillowPlugin.read() 函数调用失败。在这种情况下,你可以尝试去除 ignoregamma=True 参数,然后再次运行代码。
修改 load_llff.py 文件中的 imread 函数调用,将 ignoregamma=True 参数移除
you should replace ignoregamma=True
to apply_gamma=False
it's a latest version change from the imageio
thanks