nerfstudio-project / nerfstudio

A collaboration friendly studio for NeRFs
https://docs.nerf.studio
Apache License 2.0
9.55k stars 1.31k forks source link

TypeError: __init__() got an unexpected keyword argument 'dataparser' #2862

Closed RuihanGao closed 9 months ago

RuihanGao commented 9 months ago

Describe the bug After installing and setting up the environment, I run the example command ns-train nerfacto --data data/nerfstudio/poster and then got the following error.

It worked without error two weeks ago, so I am not sure whether it is due to some inconsistency between versions.

To Reproduce Steps to reproduce the behavior:

  1. Download and install the nerfstudio repo
  2. Run the sample command ns-train nerfacto --data data/nerfstudio/poster
  3. See error
    (ns) xxx@xxx:/data/xxx/projects/nerfstudio$ ns-train nerfacto --data data/nerfstudio/poster
    Traceback (most recent call last):
    File "/home/ruihan/anaconda3/envs/ns/bin/ns-train", line 8, in <module>
    sys.exit(entrypoint())
    File "/data/ruihan/projects/nerfstudio/nerfstudio/scripts/train.py", line 263, in entrypoint
    tyro.cli(
    File "/home/ruihan/.local/lib/python3.8/site-packages/tyro/_cli.py", line 187, in cli
    output = _cli_impl(
    File "/home/ruihan/.local/lib/python3.8/site-packages/tyro/_cli.py", line 454, in _cli_impl
    out, consumed_keywords = _calling.call_from_args(
    File "/home/ruihan/.local/lib/python3.8/site-packages/tyro/_calling.py", line 157, in call_from_args
    value, consumed_keywords_child = call_from_args(
    File "/home/ruihan/.local/lib/python3.8/site-packages/tyro/_calling.py", line 122, in call_from_args
    value, consumed_keywords_child = call_from_args(
    File "/home/ruihan/.local/lib/python3.8/site-packages/tyro/_calling.py", line 122, in call_from_args
    value, consumed_keywords_child = call_from_args(
    File "/home/ruihan/.local/lib/python3.8/site-packages/tyro/_calling.py", line 247, in call_from_args
    return unwrapped_f(*positional_args, **kwargs), consumed_keywords  # type: ignore
    TypeError: __init__() got an unexpected keyword argument 'dataparser'

Expected behavior Expected it to run the nerfacto training.

RuihanGao commented 9 months ago

Nvm, downgrading tyro package from 0.7.0 to 0.5.14 solves the problem.

brentyi commented 9 months ago

Seems like the same problem @pwais was having: https://github.com/brentyi/tyro/issues/121

I unfortunately haven't been able to reproduce this in either Python 3.8 or 3.10, including in fresh environments. Just to check @RuihanGao was this just with an unmodified clone of the nerfstudio repo? Would you be willing to share the outputs of pip freeze?

Thanks!

RuihanGao commented 9 months ago

Thanks a lot for getting back. The following is the current status of pip freeze, which works. Since I already solved the problem, just post it here for future reference.

ruihan@llama:/data/ruihan/projects/nerfstudio$ pip freeze
absl-py==2.1.0
addict==2.4.0
ansi2html==1.9.1
anyio==4.2.0
appdirs==1.4.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
astroid==2.15.2
asttokens==2.4.1
async-lru==2.0.4
attrs==23.2.0
Augmentor==0.2.9
av==11.0.0
Babel==2.14.0
backcall==0.2.0
beautifulsoup4==4.12.2
bidict==0.22.1
bleach==6.1.0
blinker==1.7.0
Brotli @ file:///tmp/abs_ecyw11_7ze/croots/recipe/brotli-split_1659616059936/work
cachetools==5.3.2
certifi @ file:///croot/certifi_1700501669400/work/certifi
cffi @ file:///croot/cffi_1700254295673/work
chardet==5.2.0
charset-normalizer==3.3.2
click==8.1.7
cmake==3.28.1
colorama @ file:///home/conda/feedstock_root/build_artifacts/colorama_1666700638685/work
colorlog==6.8.2
comet-ml==3.37.0
comm==0.2.1
ConfigArgParse==1.7
configobj==5.0.8
cryptography==42.0.2
cycler==0.12.1
dash==2.14.2
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-table==5.0.0
dataclasses @ file:///home/conda/feedstock_root/build_artifacts/dataclasses_1628958434797/work
debugpy==1.8.0
decorator==5.1.1
defusedxml==0.7.1
descartes==1.1.0
dict2class==0.1.0
dill==0.3.6
docker-pycreds==0.4.0
docstring-parser==0.15
dominate==2.9.1
dulwich==0.21.7
embreex==2.17.7.post4
everett==3.1.0
exceptiongroup==1.2.0
executing==2.0.1
fastjsonschema==2.19.1
filelock==3.13.1
fire==0.5.0
Flask==3.0.0
fonttools==4.47.2
fqdn==1.5.1
freetype-py==2.4.0
fsspec==2023.12.2
future @ file:///croot/future_1677599870788/work
fvcore @ file:///home/conda/feedstock_root/build_artifacts/fvcore_1671623667463/work
gdown==5.0.1
gitdb==4.0.9
GitPython==3.1.27
google-auth==2.27.0
google-auth-oauthlib==1.0.0
GPUtil==1.4.0
grpcio==1.60.0
h11==0.14.0
h5py==3.10.0
httpcore==1.0.2
httpx==0.26.0
idna @ file:///croot/idna_1666125576474/work
imageio==2.33.1
imageio-ffmpeg==0.4.3
importlib-metadata==7.0.1
importlib-resources==6.1.1
iopath @ file:///home/conda/feedstock_root/build_artifacts/iopath_1636568816351/work
ipykernel==6.28.0
ipython==8.12.3
ipywidgets==8.1.1
isoduration==20.11.0
isort==5.12.0
itsdangerous==2.1.2
jaxtyping==0.2.19
jedi==0.19.1
Jinja2==3.1.3
joblib==1.3.2
json5==0.9.14
jsonpatch==1.32
jsonpointer==2.3
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.9.0
jupyter-lsp==2.2.2
jupyter_client==8.6.0
jupyter_core==5.7.1
jupyter_server==2.12.5
jupyter_server_terminals==0.5.2
jupyterlab==4.0.12
jupyterlab-widgets==3.0.9
jupyterlab_pygments==0.3.0
jupyterlab_server==2.25.2
kiwisolver==1.4.5
lazy-object-proxy==1.9.0
lazy_loader==0.3
lightning-utilities==0.10.1
lit==17.0.6
lpips==0.1.4
lxml==5.1.0
mapbox-earcut==1.0.1
Markdown==3.5.2
markdown-it-py==3.0.0
MarkupSafe==2.1.4
matplotlib==3.5.3
matplotlib-inline==0.1.6
mccabe==0.7.0
mdurl==0.1.2
mediapy==1.2.0
mistune==3.0.2
mpmath==1.3.0
msgpack==1.0.7
msgpack-numpy==0.4.8
nbclient==0.9.0
nbconvert==7.14.2
nbformat==5.9.2
nerfacc==0.5.2
-e git+https://github.com/RuihanGao/nerfstudio.git@edb6997f25ae01998a171b5ffd576a9ec7ad30e4#egg=nerfstudio
nest-asyncio==1.5.8
networkx==3.1
ninja==1.11.1.1
nodeenv==1.8.0
notebook==7.0.6
notebook_shim==0.2.3
numpy==1.24.4
nuscenes-devkit==1.1.11
oauthlib==3.2.2
open3d==0.18.0
opencv-python==4.6.0.66
overrides==7.7.0
packaging==23.2
pandas==2.0.3
pandocfilters==1.5.0
parso==0.8.3
pathtools==0.1.2
pexpect==4.9.0
pickleshare==0.7.5
pillow==10.2.0
pkgutil_resolve_name==1.3.10
platformdirs==3.2.0
plotly==5.18.0
portalocker @ file:///home/conda/feedstock_root/build_artifacts/portalocker_1695662050140/work
prometheus-client==0.19.0
promise==2.3
prompt-toolkit==3.0.43
protobuf==3.20.1
psutil==5.9.8
ptyprocess==0.7.0
pure-eval==0.2.2
pyasn1==0.5.1
pyasn1-modules==0.3.0
pycocotools==2.0.7
pycollada==0.8
pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work
pyglet==2.0.10
Pygments==2.17.2
pyliblzfse==0.4.1
pylint==2.17.2
pymeshlab==2023.12.post1
pyngrok==7.0.5
PyOpenGL==3.1.0
pyOpenSSL @ file:///croot/pyopenssl_1690223430423/work
pyparsing==3.1.1
pyquaternion==0.9.9
pyrender==0.1.45
PySocks @ file:///tmp/build/80754af9/pysocks_1605305779399/work
pyspng==0.1.0
python-box==6.1.0
python-dateutil==2.8.2
python-engineio==4.8.2
python-json-logger==2.0.7
python-socketio==5.11.0
pytorch3d==0.7.5
pytz==2023.3.post1
PyWavelets==1.4.1
PyYAML==6.0.1
pyzmq==25.1.2
qtconsole==5.5.1
QtPy==2.4.1
rawpy==0.19.0
referencing==0.33.0
requests==2.31.0
requests-oauthlib==1.3.1
requests-toolbelt==1.0.0
retrying==1.3.4
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rich==13.7.0
rpds-py==0.17.1
rsa==4.9
Rtree==1.1.0
scikit-image==0.21.0
scikit-learn==1.3.2
scipy==1.10.1
semantic-version==2.10.0
Send2Trash==1.8.2
sentry-sdk==1.5.10
setproctitle==1.2.3
Shapely==1.8.5.post1
shortuuid==1.0.8
shtab==1.6.5
simple-websocket==1.0.0
simplejson==3.19.2
six==1.16.0
smmap==5.0.0
sniffio==1.3.0
soupsieve==2.5
splines==0.3.0
stack-data==0.6.3
svg.path==6.3
sympy==1.12
tabulate @ file:///home/conda/feedstock_root/build_artifacts/tabulate_1665138452165/work
tenacity==8.2.3
tensorboard==2.14.0
tensorboard-data-server==0.7.2
termcolor==2.4.0
terminado==0.18.0
threadpoolctl==3.2.0
tifffile==2023.7.10
timm==0.6.7
tinycss2==1.2.1
tinycudann @ git+https://github.com/NVlabs/tiny-cuda-nn/@c12645dfbac707ccd82907a209edff9b258f1e3d#subdirectory=bindings/torch
tomli==2.0.1
tomlkit==0.11.7
torch==2.1.2+cu118
torch-fidelity==0.3.0
torchfile==0.1.0
torchmetrics==1.3.0.post0
torchvision==0.16.2+cu118
tornado==6.4
tqdm @ file:///home/conda/feedstock_root/build_artifacts/tqdm_1691671248568/work
traitlets==5.14.1
trimesh==4.1.0
triton==2.1.0
typeguard==4.1.5
types-python-dateutil==2.8.19.20240106
typing_extensions==4.9.0
tyro==0.5.14
tzdata==2023.4
uri-template==1.3.0
urllib3 @ file:///croot/urllib3_1698257533958/work
vhacdx==0.0.5
visdom==0.1.8.9
viser==0.1.7
wandb==0.16.2
wcwidth==0.2.13
webcolors==1.13
webencodings==0.5.1
websocket-client==1.3.2
websockets==12.0
Werkzeug==3.0.1
widgetsnbextension==4.0.9
wrapt==1.15.0
wsproto==1.2.0
wurlitzer==3.0.3
xatlas==0.0.8
xxhash==3.4.1
yacs @ file:///home/conda/feedstock_root/build_artifacts/yacs_1645705974477/work
yourdfpy==0.0.56
zipp==3.17.0
brentyi commented 9 months ago

Glad you have it working!

As an FYI there are some subtle issues with older versions of tyro though, so downgrading isn't the best solution. For example, https://github.com/nerfstudio-project/nerfstudio/issues/2789 wasn't fixed until tyro>=0.6.6. Did you try any of the 0.6.x versions of tyro before going to 0.5.14?

On my end I still can't reproduce, even after matching your environment :(

RuihanGao commented 9 months ago

Though I am not sure why it can't be reproduced, I tried tyro=0.6.6 and it works. In that case, maybe tyro=0.6.6 is a sweet spot. Thanks for pointing out!

brentyi commented 9 months ago

I tracked down an old commit of nerfstudio where I was able to reproduce the error; should be fixed in tyro==0.7.1!