iNeRF-public icon indicating copy to clipboard operation
iNeRF-public copied to clipboard

Run the code on Colab

Open ge35tay opened this issue 2 years ago • 5 comments

Hi, i try to run the code on the colab, and I find that the code run perfectly on my local laptop(fail because of fun out of PU memory), but on the Colab it throw out an error call "parseexception: expected '}', found '=' (at char 759), (line:34, col:18)" in cell "def extra_args(parser):". It is quiet weird. Because I think parser arg is greatly written, on the other hand when I run the cell locally there is no problem at all. Did u have any idea?

ge35tay avatar May 16 '22 16:05 ge35tay

I am facing the same issue when running on my Mac M1. My environment is as follows:

# Name                    Version                   Build  Channel
absl-py                   1.4.0                    pypi_0    pypi
appdirs                   1.4.4              pyhd3eb1b0_0  
appnope                   0.1.3              pyhd8ed1ab_0    conda-forge
asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                pyhd8ed1ab_3    conda-forge
backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
blas                      2.116                  openblas    conda-forge
blas-devel                3.9.0           16_osxarm64_openblas    conda-forge
blosc                     1.21.3               h313beb8_0  
brotli                    1.0.9                h1a28f6b_7  
brotli-bin                1.0.9                h1a28f6b_7  
brotlipy                  0.7.0           py39h1a28f6b_1002  
brunsli                   0.1                  hc377ac9_1  
bzip2                     1.0.8                h620ffc9_4  
c-ares                    1.18.1               h1a28f6b_0  
ca-certificates           2022.12.7            h4653dfc_0    conda-forge
cachetools                5.3.0                    pypi_0    pypi
certifi                   2022.12.7          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1           py39h80987f9_3  
cfitsio                   3.470                h7f6438f_7  
charls                    2.2.0                hc377ac9_0  
charset-normalizer        2.0.4              pyhd3eb1b0_0  
cloudpickle               2.0.0              pyhd3eb1b0_0  
comm                      0.1.2              pyhd8ed1ab_0    conda-forge
contourpy                 1.0.5            py39h525c30c_0  
cryptography              39.0.1           py39h834c97f_0  
cycler                    0.11.0             pyhd3eb1b0_0  
cytoolz                   0.12.0           py39h1a28f6b_0  
dask-core                 2022.7.0         py39hca03da5_0  
debugpy                   1.6.6            py39h23fbdae_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
dotmap                    1.3.30                   pypi_0    pypi
executing                 1.2.0              pyhd8ed1ab_0    conda-forge
flit-core                 3.6.0              pyhd3eb1b0_0  
fonttools                 4.25.0             pyhd3eb1b0_0  
freetype                  2.12.1               h1192e45_0  
fsspec                    2022.11.0        py39hca03da5_0  
future                    0.18.3           py39hca03da5_0  
giflib                    5.2.1                h80987f9_3  
google-auth               2.16.2                   pypi_0    pypi
google-auth-oauthlib      0.4.6                    pypi_0    pypi
grpcio                    1.51.3                   pypi_0    pypi
idna                      3.4              py39hca03da5_0  
imagecodecs               2021.8.26        py39hb8286cb_2  
imageio                   2.26.0           py39hca03da5_0  
imageio-ffmpeg            0.4.8                    pypi_0    pypi
importlib-metadata        6.0.0              pyha770c72_0    conda-forge
importlib_metadata        6.0.0                hd8ed1ab_0    conda-forge
importlib_resources       5.2.0              pyhd3eb1b0_1  
ipdb                      0.13.11                  pypi_0    pypi
ipykernel                 6.21.2             pyh736e0ef_0    conda-forge
ipython                   8.11.0             pyhd1c38e8_0    conda-forge
jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
jpeg                      9e                   h80987f9_1  
jupyter_client            8.0.3              pyhd8ed1ab_0    conda-forge
jupyter_core              4.12.0           py39h2804cbe_0    conda-forge
jxrlib                    1.1                  h1a28f6b_2  
kiwisolver                1.4.4            py39h313beb8_0  
krb5                      1.20.1               h69eda48_0    conda-forge
lcms2                     2.12                 hba8e193_0  
lerc                      3.0                  hc377ac9_0  
libaec                    1.0.4                hc377ac9_1  
libblas                   3.9.0           16_osxarm64_openblas    conda-forge
libbrotlicommon           1.0.9                h1a28f6b_7  
libbrotlidec              1.0.9                h1a28f6b_7  
libbrotlienc              1.0.9                h1a28f6b_7  
libcblas                  3.9.0           16_osxarm64_openblas    conda-forge
libcurl                   7.88.1               h9049daf_0    conda-forge
libcxx                    14.0.6               h848a8c0_0  
libdeflate                1.17                 h80987f9_0  
libedit                   3.1.20221030         h80987f9_0  
libev                     4.33                 h1a28f6b_1  
libffi                    3.4.2                hca03da5_6  
libgfortran               5.0.0           11_3_0_hca03da5_28  
libgfortran5              11.3.0              h009349e_28  
liblapack                 3.9.0           16_osxarm64_openblas    conda-forge
liblapacke                3.9.0           16_osxarm64_openblas    conda-forge
libnghttp2                1.52.0               hae82a92_0    conda-forge
libopenblas               0.3.21          openmp_hc731615_3    conda-forge
libpng                    1.6.39               h80987f9_0  
libprotobuf               3.16.0               hccf11d3_0    conda-forge
libsodium                 1.0.18               h27ca646_1    conda-forge
libsqlite                 3.40.0               h76d750c_0    conda-forge
libssh2                   1.10.0               h7a5bd25_3    conda-forge
libtiff                   4.5.0                h313beb8_2  
libwebp                   1.2.4                ha3663a8_1  
libwebp-base              1.2.4                h80987f9_1  
libzlib                   1.2.13               h03a7124_4    conda-forge
libzopfli                 1.0.3                hc377ac9_0  
llvm-openmp               14.0.6               hc6e5704_0  
locket                    1.0.0            py39hca03da5_0  
lpips                     0.1.4                    pypi_0    pypi
lz4-c                     1.9.4                h313beb8_0  
markdown                  3.4.1                    pypi_0    pypi
markupsafe                2.1.2                    pypi_0    pypi
matplotlib                3.7.0            py39hca03da5_0  
matplotlib-base           3.7.0            py39h78102c4_0  
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mediapy                   1.1.6                    pypi_0    pypi
munch                     2.5.0                    pypi_0    pypi
munkres                   1.1.4                      py_0  
ncurses                   6.4                  h313beb8_0  
nest-asyncio              1.5.6              pyhd8ed1ab_0    conda-forge
networkx                  2.8.4            py39hca03da5_0  
ninja                     1.10.2               hca03da5_5  
ninja-base                1.10.2               h525c30c_5  
numpy                     1.23.5           py39h1398885_0  
numpy-base                1.23.5           py39h90707a3_0  
oauthlib                  3.2.2                    pypi_0    pypi
openblas                  0.3.21          openmp_hf78f355_3    conda-forge
opencv-python             4.7.0.72                 pypi_0    pypi
openjpeg                  2.3.0                h7a6adac_2  
openssl                   3.0.8                h03a7124_0    conda-forge
packaging                 22.0             py39hca03da5_0  
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
partd                     1.2.0              pyhd3eb1b0_1  
pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    9.4.0            py39h313beb8_0  
pip                       22.3.1           py39hca03da5_0  
pooch                     1.4.0              pyhd3eb1b0_0  
pretrainedmodels          0.7.4                    pypi_0    pypi
prompt-toolkit            3.0.38             pyha770c72_0    conda-forge
prompt_toolkit            3.0.38               hd8ed1ab_0    conda-forge
protobuf                  4.22.0                   pypi_0    pypi
psutil                    5.9.4            py39h02fc5c5_0    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pyasn1                    0.4.8                    pypi_0    pypi
pyasn1-modules            0.2.8                    pypi_0    pypi
pycparser                 2.21               pyhd3eb1b0_0  
pygments                  2.14.0             pyhd8ed1ab_0    conda-forge
pyhocon                   0.3.60                   pypi_0    pypi
pyopenssl                 23.0.0           py39hca03da5_0  
pyparsing                 3.0.9            py39hca03da5_0  
pysocks                   1.7.1            py39hca03da5_0  
python                    3.9.16          hea58f1e_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd3eb1b0_0  
python_abi                3.9                      2_cp39    conda-forge
pytorch                   1.8.0           cpu_py39h8ae5edc_3    conda-forge
pywavelets                1.4.1            py39h80987f9_0  
pyyaml                    6.0              py39h80987f9_1  
pyzmq                     25.0.0           py39h0553236_0    conda-forge
readline                  8.2                  h1a28f6b_0  
requests                  2.28.1           py39hca03da5_0  
requests-oauthlib         1.3.1                    pypi_0    pypi
rsa                       4.9                      pypi_0    pypi
scikit-image              0.17.2           py39ha4bedbf_4    conda-forge
scipy                     1.10.0           py39h9d039d2_1  
setuptools                65.6.3           py39hca03da5_0  
six                       1.16.0             pyhd3eb1b0_1  
sleef                     3.5.1                hf27765b_1  
snappy                    1.1.9                hc377ac9_0  
sqlite                    3.40.1               h7a7dc30_0  
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
tensorboard               2.12.0                   pypi_0    pypi
tensorboard-data-server   0.7.0                    pypi_0    pypi
tensorboard-plugin-wit    1.8.1                    pypi_0    pypi
tifffile                  2021.7.2           pyhd3eb1b0_2  
tk                        8.6.12               hb8d0fd4_0  
tomli                     2.0.1                    pypi_0    pypi
toolz                     0.12.0           py39hca03da5_0  
torchvision               0.9.0           py39h0a40b5a_0_cpu    conda-forge
tornado                   6.2              py39h1a28f6b_0  
tqdm                      4.64.1           py39hca03da5_0  
traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
typing_extensions         4.4.0            py39hca03da5_0  
tzdata                    2022g                h04d1e81_0  
urllib3                   1.26.14          py39hca03da5_0  
wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
werkzeug                  2.2.3                    pypi_0    pypi
wheel                     0.38.4           py39hca03da5_0  
xz                        5.2.10               h80987f9_1  
yaml                      0.2.5                h1a28f6b_0  
zeromq                    4.3.4                hbdafb3b_1    conda-forge
zfp                       0.5.5                hc377ac9_6  
zipp                      3.11.0           py39hca03da5_0  
zlib                      1.2.13               h03a7124_4    conda-forge
zstd                      1.5.2                h8574219_0  

Can you share your local environment?

pra-dan avatar Mar 04 '23 06:03 pra-dan

Here is the simpler reproduced error: There is no error when there is no include required("default.conf") in the .conf file. For e.g.,

>>> from pyhocon import ConfigFactory
>>> conf = ConfigFactory.parse_file('conf/default.cnf') # successful
>>>

But for the file required in this project:

>>> from pyhocon import ConfigFactory
>>> conf = ConfigFactory.parse_file('conf/exp/srn.conf')
pyparsing.exceptions.ParseException: Expected '}', found '='  (at char 759), (line:34, col:18)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/prashantdandriyal/miniforge3/envs/pixelnerf2/lib/python3.9/site-packages/pyhocon/config_parser.py", line 142, in parse_file
    return cls.parse_string(content, os.path.dirname(filename), resolve, unresolved_value)
  File "/Users/prashantdandriyal/miniforge3/envs/pixelnerf2/lib/python3.9/site-packages/pyhocon/config_parser.py", line 192, in parse_string
    return ConfigParser().parse(content, basedir, resolve, unresolved_value)
  File "/Users/prashantdandriyal/miniforge3/envs/pixelnerf2/lib/python3.9/site-packages/pyhocon/config_parser.py", line 455, in parse
    config = config_expr.parseString(content, parseAll=True)[0]
  File "/Users/prashantdandriyal/miniforge3/envs/pixelnerf2/lib/python3.9/site-packages/pyparsing/core.py", line 1141, in parse_string
    raise exc.with_traceback(None)
pyparsing.exceptions.ParseSyntaxException: Expected '}', found '='  (at char 759), (line:34, col:18)

pra-dan avatar Mar 04 '23 10:03 pra-dan

Hi pra-dan, I am encountering the same issue. I tried to use your modified code but it's still occurring. How should I be running it in Colab?

tsubu01 avatar Apr 09 '23 13:04 tsubu01

@tsubu01 Hi.

I ran it locally so can't exactly say much. I recommend that you start with trying different versions of pyhocon and ensuring that the conf file can be loaded (similar to what I did above).

pra-dan avatar Apr 10 '23 04:04 pra-dan

Thanks! I eventually solved it.

  1. I replaced the environment.yml file to one without version restrictions,
  2. I converted the ipynb to py.

tsubu01 avatar Apr 10 '23 11:04 tsubu01