DSNeRF
DSNeRF copied to clipboard
OSError: cannot write mode F as PNG
Hi all,
I am trying to run python run_nerf.py --config configs/leaves_2v.txt --render_only --chunk=16384 --netchunk=32768
with the pre-trained model. However, I receive the following logs:
python run_nerf.py --config configs/leaves_2v.txt --render_only --chunk=16384 --netchunk=32768 Loaded colmap llff (6, 756, 1008, 3) (120, 3, 5) [ 756. 1008. 863.3505] ./data/split_allview_npy/leaves_2view DEFINING BOUNDS NEAR FAR 1.2630987882614135 15.368377685546875 Found ckpts ['./logs/release/leaves_2v/50000.tar'] Reloading from ./logs/release/leaves_2v/50000.tar Not ndc! RENDER ONLY test poses shape torch.Size([120, 3, 5]) 0%| | 0/120 [00:00<?, ?it/s]0 0.0007996559143066406 /home/won147/miniconda3/envs/dsnerf/lib/python3.8/site-packages/torch/functional.py:507: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3549.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] torch.Size([756, 1008, 3]) torch.Size([756, 1008]) max: 15.368378 0%| | 0/120 [01:51<?, ?it/s] Traceback (most recent call last): File "/home/won147/miniconda3/envs/dsnerf/lib/python3.8/site-packages/PIL/PngImagePlugin.py", line 1279, in _save rawmode, mode = _OUTMODES[mode] KeyError: 'F'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "run_nerf.py", line 1134, in
I am using python 3.8, any suggestions are appreciated!
I'm having the same issue, maybe changing the 186 lines of the run_nerf.py to depth=depth.cpu().numpy().astype(np.uint8)
would solve the problem
Hi, I think this is due to the mismatch of data types which happens in newer versions of PIL, and the answer above solves the problem.