wutong16 / Voxurf

[ ICLR 2023 Spotlight ] Pytorch implementation for "Voxurf: Voxel-based Efficient and Accurate Neural Surface Reconstruction"
Other
402 stars 28 forks source link

Yapf error [lib2to3.pgen2.parse.ParseError: bad input:] #13

Open hcjghr opened 1 year ago

hcjghr commented 1 year ago

Hi,

I was wondering if anybody has encountered such an error when trying to run with DTU (or any dataset). For example running command:

bash single_runner.sh configs/dtu_e2e exp 122

Gives error: Loading extension module total_variation_cuda... 2023-04-14 12:49:18,257 - INFO - + + + + + + + + + + scan122/coarse + + + + + + + + + + 2023-04-14 12:49:18,257 - INFO - + + + + + + + + + + ./logs/dtu/exp/scan122/coarse/log + + + + + + + + + + 2023-04-14 12:49:18,257 - INFO - + + + + + + + + + + 122 black bg + + + + + + + + + + 2023-04-14 12:49:18,257 - INFO - scan122/coarse Using /home/klemen/.cache/torch_extensions/py38_cu113 as PyTorch extensions root... No modifications detected for re-loaded extension module render_utils_cuda, skipping build step... Loading extension module render_utils_cuda... Train with all the images: True * [ resolution level 2 | train all True | wmask True | white_bg False] Date original shape: 1200 1600 Loaded dtu (64, 600, 800, 3) (7, 4, 4) [600, 800, 1446.1654052734375] ./data/DTU/dtu_scan122 Split: train 64 | validate 7 | test 7 near, far: 0.2798233985900879 5.596468 2023-04-14 12:49:34,392 - INFO - train: start Traceback (most recent call last): File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/site-packages/yapf/yapflib/pytree_utils.py", line 119, in ParseCodeToTree tree = parser_driver.parse_string(code, debug=False) File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/lib2to3/pgen2/driver.py", line 103, in parse_string return self.parse_tokens(tokens, debug) File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/lib2to3/pgen2/driver.py", line 71, in parse_tokens if p.addtoken(type, value, (prefix, start)): File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/lib2to3/pgen2/parse.py", line 162, in addtoken raise ParseError("bad input", type, value, context) lib2to3.pgen2.parse.ParseError: bad input: type=20, value='<', context=('', (1, 3))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/site-packages/yapf/yapflib/pytree_utils.py", line 125, in ParseCodeToTree tree = parser_driver.parse_string(code, debug=False) File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/lib2to3/pgen2/driver.py", line 103, in parse_string return self.parse_tokens(tokens, debug) File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/lib2to3/pgen2/driver.py", line 71, in parse_tokens if p.addtoken(type, value, (prefix, start)): File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/lib2to3/pgen2/parse.py", line 162, in addtoken raise ParseError("bad input", type, value, context) lib2to3.pgen2.parse.ParseError: bad input: type=20, value='<', context=('', (1, 3))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/site-packages/yapf/yapflib/yapf_api.py", line 183, in FormatCode tree = pytree_utils.ParseCodeToTree(unformatted_source) File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/site-packages/yapf/yapflib/pytree_utils.py", line 131, in ParseCodeToTree raise e File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/site-packages/yapf/yapflib/pytree_utils.py", line 129, in ParseCodeToTree ast.parse(code) File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/ast.py", line 47, in parse return compile(source, filename, mode, flags, File "", line 1 os=<module 'os' from '/home/klemen/anaconda3/envs/voxurf/lib/python3.8/os.py'> ^ SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run.py", line 1024, in train(args, cfg, data_dict) File "run.py", line 811, in train cfg.dump(os.path.join(cfg.basedir, cfg.expname, 'config.py')) File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/site-packages/mmcv/utils/config.py", line 374, in dump f.write(self.pretty_text) File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/site-packages/mmcv/utils/config.py", line 338, in prettytext text, = FormatCode(text, style_config=yapf_style, verify=True) File "/home/klemen/anaconda3/envs/voxurf/lib/python3.8/site-packages/yapf/yapflib/yapf_api.py", line 186, in FormatCode raise errors.YapfError(errors.FormatErrorMsg(e)) yapf.yapflib.errors.YapfError: :1:4: invalid syntax

I tried with conda environments with python 3.8, 3.9 and 3.10 with pytorch and torch-scatter installed using:

pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113 pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+cu113.html

I know it seems like an error with yapf library so I'm also wondering what python/yapf version is advisable to use to make the code run.

Thanks for any help.

Lynd-Z commented 1 year ago

same problem

zhaihongjia commented 1 year ago

pip uninstall mmcv pip install mmcv==1.7.1