google / nerfactor

Neural Factorization of Shape and Reflectance Under an Unknown Illumination
https://xiuming.info/projects/nerfactor/
Apache License 2.0
437 stars 56 forks source link

Running the Data Example #1

Closed ntseng450 closed 3 years ago

ntseng450 commented 3 years ago

Hello, the results look very impressive in the paper and I'm excited to try out the repository myself but am having some issues with getting the scripts in the Read-Me to run without error.

I downloaded the data and went to the nerfactor section step 1 for learn data-driven BRDF priors. At this point I don't have data/brdf_merl_npz/ims512_envmaph16_spp1, is this something that needs to be generated with data_gen/merl/make_dataset_run.sh? If so, when I follow the instructions in the data_gen folder, I get the following error message when running data_gen/merl/make_dataset_run.sh.

Training & Validation: 0%| | 0/4 [00:00<?, ?it/s]Loading MERL-BRDF: \ /mnt/c/Users/Documents/wrk_dir/data/brdf_merl/Copyright_Notice.txt\ Training & Validation: 0%| | 0/4 [00:00<?, ?it/s]\ Traceback (most recent call last):\ File "/mnt/c/Users/Documents/wrk_dir/code/nerfactor/data_gen/merl/make_dataset.py", line 144, in \ app.run(main) File "/home/user/anaconda3/envs/nerfactor/lib/python3.6/site-packages/absl/app.py", line 312, in run _run_main(main, args) File "/home/user/anaconda3/envs/nerfactor/lib/python3.6/site-packages/absl/app.py", line 258, in _run_main sys.exit(main(argv)) File "/mnt/c/Users/Documents/wrk_dir/code/nerfactor/data_gen/merl/make_dataset.py", line 75, in main brdf = MERL(path=path) File "/mnt/c/Users/Documents/wrk_dir/code/nerfactor/brdf/merl/merl.py", line 31, in init cube_rgb = merl.readMERLBRDF(path) # (phi_d, theta_h, theta_d, ch) File "/mnt/c/Users/Documents/wrk_dir/code/nerfactor/third_party/nielsen2015on/merlFunctions.py", line 19, in readMERLBRDF BRDFVals = np.swapaxes(np.reshape(vals,(dims[2], dims[1], dims[0], 3),'F'),1,2) File "<__array_function__ internals>", line 6, in reshape File "/home/user/anaconda3/envs/nerfactor/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 299, in reshape return _wrapfunc(a, 'reshape', newshape, order=order) File "/home/user/anaconda3/envs/nerfactor/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 58, in _wrapfunc return bound(*args, **kwds) ValueError: cannot reshape array of size 144 into shape (808591476,1751607666,2037411651,3)

Resolved: need to move the brdfs folder out of the downloaded data and move/delete the Readme inside the folder.

cjw531 commented 3 years ago

Here is a more detailed explanation how to address this shape mismatch / incorrectly loaded MERL dataset.