Git Product home page Git Product logo

Comments (4)

cjw531 avatar cjw531 commented on April 30, 2024 7

Fixed this issue by re-checking the *.binary merl dataset. Below is how I solved this issue and load the T/V/T set in a proper way.

TL;DR> The provided path is incorrect in the README, if you are using the downloaded MERL dataset directly, you have to modify the path. The data path that you use in indir variable should contain the actual MERL dataset, not other unnecessary files that are not ending with *.binary.

Download Dataset
When you download the MERL BRDF dataset, the directory structure will be as follows:

brdf_merl/
├── Readme.txt
├── Copyright_Notice.txt
├── brdfs
│   ├── Readme.txt
│   └── *.binary (<--100 of them are here, omitted)
└── code
    └── BRDFRead.cpp

Modify the path
In the README, the data path is set as follows:

indir="$proj_root/data/brdf_merl"

However, if you use this brdf_merl/ directory directly here, it will give you an error like me because the data generator code is trying to read the invalid folders/files such as Readme.txt, Copyright_Notice.txt, code/, and etc. Your folder path should only contain the *.binary files.
Also, the brdfs/ folder has another Readme.txt file, so remember to get rid of this before running the code.
Therefore, fixing the indir variable into:

indir="$proj_root/data/brdf_merl/brdfs"

will resolve the issue because this brdfs folder contains the actual dataset only.

*Side note: I also set ims='512' instead of 256 because in the later step where you train brdf priors, it seems like the data_root variable uses the one with the size of 512.

from nerfactor.

xiumingzhang avatar xiumingzhang commented on April 30, 2024

from nerfactor.

cjw531 avatar cjw531 commented on April 30, 2024

I tried to recreate the *.npz dataset, with train/val/test split. However, it only creates test.npz and gives this reshape error as follows:

$ REPO_DIR="$repo_dir" "$repo_dir"/data_gen/merl/make_dataset_run.sh "$indir" "$ims" "$outdir"
Training & Validation:   0%|                                                                       | 0/5 [00:00<?, ?it/s]Loading MERL-BRDF:  /Users/jchoi/workspace/nerfactor/data/brdf_merl/Copyright_Notice.txt
Training & Validation:   0%|                                                                       | 0/5 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/Users/jchoi/workspace/nerfactor/data_gen/merl/make_dataset.py", line 144, in <module>
    app.run(main)
  File "/Users/jchoi/miniconda3/envs/nerfactor/lib/python3.6/site-packages/absl/app.py", line 312, in run
    _run_main(main, args)
  File "/Users/jchoi/miniconda3/envs/nerfactor/lib/python3.6/site-packages/absl/app.py", line 258, in _run_main
    sys.exit(main(argv))
  File "/Users/jchoi/workspace/nerfactor/data_gen/merl/make_dataset.py", line 75, in main
    brdf = MERL(path=path)
  File "/Users/jchoi/workspace/nerfactor/brdf/merl/merl.py", line 31, in __init__
    cube_rgb = merl.readMERLBRDF(path) # (phi_d, theta_h, theta_d, ch)
  File "/Users/jchoi/workspace/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 "/Users/jchoi/miniconda3/envs/nerfactor/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 299, in reshape
    return _wrapfunc(a, 'reshape', newshape, order=order)
  File "/Users/jchoi/miniconda3/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)

I believe the directory where I have saved the donwloaded BRDF dataset does not have issue since it creates the test numpy array.
It seems like someone opened same issue before, not sure how he resolved it by deleting readme inside the downloaded brdf folder.


UPDATE:
I got this message, but no train.npz nor validation.npz created.

Training & Validation: 0it [00:00, ?it/s]

from nerfactor.

xiumingzhang avatar xiumingzhang commented on April 30, 2024

Hi, I suspect the BRDF data were not even successfully loaded. Could you try inserting a breakpoint right before nerfactor/third_party/nielsen2015on/merlFunctions.py L19? What is vals at that point? If vals is empty there, then that explains the errors you had.

from nerfactor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.