filaPro / oneformer3d

[CVPR2024] OneFormer3D: One Transformer for Unified Point Cloud Segmentation
Other
351 stars 32 forks source link

Error when train and test with s3dis #51

Closed ckzhkmk closed 7 months ago

ckzhkmk commented 7 months ago

I have got some problems when train and test on dataset s3dis. I follow the instruction but i got error below when i run the command python tools/train.py configs/instance-only-oneformer3d_1xb2_scannet-and-structured3d.py and python tools/test.py configs/oneformer3d_1xb2_s3dis-area-5.py \ work_dirs/oneformer3d_1xb2_s3dis-area-5/epoch_512.pth.

And the error is like: Traceback (most recent call last): File "/mnt/oneformer3d/tools/test.py", line 149, in main() File "/mnt/oneformer3d/tools/test.py", line 103, in main cfg = Config.fromfile(args.config) File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 178, in fromfile cfg_dict, cfg_text, env_variables = Config._file2dict( File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 522, in _file2dict eval(codeobj, global_locals_var, global_locals_var) File "", line 2, in File "/mnt/oneformer3d/oneformer3d/oneformer3d.py", line 10, in from .mask_matrix_nms import mask_matrix_nms ImportError: attempted relative import with no known parent package Exception ignored in: <function _TemporaryFileCloser.del at 0x7f920c87cca0> Traceback (most recent call last): File "/opt/conda/lib/python3.10/tempfile.py", line 450, in del self.close() File "/opt/conda/lib/python3.10/tempfile.py", line 446, in close unlink(self.name) FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpxkupznvh/tmpvcfhkk8u.py'

How can I fixed it?

oneformer3d-contributor commented 7 months ago

from .mask_matrix_nms import mask_matrix_nms for sure should work fine, smth is wrong with your installation. Can i see the full log of this run?

ckzhkmk commented 7 months ago

from .mask_matrix_nms import mask_matrix_nms for sure should work fine, smth is wrong with your installation. Can i see the full log of this run?

I used the Dockerfile for installation.And actually it is alost the full log

root@7a8decf9c284:/mnt/oneformer3d# python tools/test.py configs/oneformer3d_1xb2_s3dis-area-5.py \

work_dirs/oneformer3d_1xb2_s3dis-area-5.pth /opt/conda/lib/python3.10/site-packages/MinkowskiEngine/init.py:36: UserWarning: The environment variable OMP_NUM_THREADS not set. MinkowskiEngine will automatically set OMP_NUM_THREADS=16. If you want to set OMP_NUM_THREADS manually, please export it on the command line before running a python script. e.g. export OMP_NUM_THREADS=12; python your_program.py. It is recommended to set it below 24. warnings.warn( Traceback (most recent call last): File "/mnt/oneformer3d/tools/test.py", line 149, in main() File "/mnt/oneformer3d/tools/test.py", line 103, in main cfg = Config.fromfile(args.config) File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 178, in fromfile cfg_dict, cfg_text, env_variables = Config._file2dict( File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 522, in _file2dict eval(codeobj, global_locals_var, global_locals_var) File "", line 2, in File "/mnt/oneformer3d/oneformer3d/oneformer3d.py", line 10, in from .mask_matrix_nms import mask_matrix_nms ImportError: attempted relative import with no known parent package Exception ignored in: <function _TemporaryFileCloser.del at 0x7f920c87cca0> Traceback (most recent call last): File "/opt/conda/lib/python3.10/tempfile.py", line 450, in del self.close() File "/opt/conda/lib/python3.10/tempfile.py", line 446, in close unlink(self.name) FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpxkupznvh/tmpvcfhkk8u.py'

oneformer3d-contributor commented 7 months ago

May be adding PYTHONPATH=./ python test.py ... helps?

I've just built the docker image from scratch, git cloned this repo there, add PYTHONPATH, and everything is file.

ckzhkmk commented 7 months ago

No,it not works. I also met the same problem as #10 and #17,so I follow the advise to add from mmdet3d.registry import MODELS from oneformer3d import * MODELS.module_dict['S3DISOneFormer3D'] in the code and then it comes to the problem I post above.

oneformer3d-contributor commented 7 months ago

So, the relative import problem is caused by this code modification? The code for sure should not be modified. This 3 lines example is just to figure out the previous problem...

ckzhkmk commented 7 months ago

So, the relative import problem is caused by this code modification? The code for sure should not be modified. This 3 lines example is just to figure out the previous problem...

But without the modification I will just get the same result as #10 and #17. Anyway thank you, maybe I should build the enivornment again.

ckzhkmk commented 7 months ago

So, the relative import problem is caused by this code modification? The code for sure should not be modified. This 3 lines example is just to figure out the previous problem...

So sorry to brother you again,I have rebuilt the enivornment and adding PYTHONPATH=./ python test.py ... looks like works there is no ImportError but still have some other errors the full log is bellow.How can i fix it?

root@0a34eab58da9:/mnt/oneformer3d# PYTHONPATH=./ python tools/train.py configs/oneformer3d_1xb2_s3dis-area-5.py /opt/conda/lib/python3.10/site-packages/MinkowskiEngine/init.py:36: UserWarning: The environment variable OMP_NUM_THREADS not set. MinkowskiEngine will automatically set OMP_NUM_THREADS=16. If you want to set OMP_NUM_THREADS manually, please export it on the command line before running a python script. e.g. export OMP_NUM_THREADS=12; python your_program.py. It is recommended to set it below 24. warnings.warn( /opt/conda/lib/python3.10/site-packages/mmdet3d/evaluation/functional/kitti_utils/eval.py:10: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details. def get_thresholds(scores: np.ndarray, num_gt, num_sample_pts=41): /opt/conda/lib/python3.10/site-packages/torch/cuda/init.py:497: UserWarning: Can't initialize NVML warnings.warn("Can't initialize NVML") 04/23 06:08:09 - mmengine - INFO -

System environment: sys.platform: linux Python: 3.10.8 (main, Nov 4 2022, 13:48:29) [GCC 11.2.0] CUDA available: True numpy_random_seed: 1080071108 GPU 0: NVIDIA RTX A6000 CUDA_HOME: /opt/conda NVCC: Cuda compilation tools, release 11.6, V11.6.124 GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 PyTorch: 1.13.1 PyTorch compiling details: PyTorch built with:

Runtime environment: cudnn_benchmark: False mp_cfg: {'mp_start_method': 'fork', 'opencv_num_threads': 0} dist_cfg: {'backend': 'nccl'} seed: None Distributed launcher: none Distributed training: False GPU number: 1

Traceback (most recent call last): File "/opt/conda/lib/python3.10/site-packages/yapf/pytree/pytree_utils.py", line 116, in ParseCodeToTree tree = parser_driver.parse_string(code, debug=False) File "/opt/conda/lib/python3.10/lib2to3/pgen2/driver.py", line 103, in parse_string return self.parse_tokens(tokens, debug) File "/opt/conda/lib/python3.10/lib2to3/pgen2/driver.py", line 71, in parse_tokens if p.addtoken(type, value, (prefix, start)): File "/opt/conda/lib/python3.10/lib2to3/pgen2/parse.py", line 119, in addtoken ilabel = self.classify(type, value, context) File "/opt/conda/lib/python3.10/lib2to3/pgen2/parse.py", line 175, in classify raise ParseError("bad token", type, value, context) lib2to3.pgen2.parse.ParseError: bad token: type=58, value='\x1b', context=('', (41, 7))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/conda/lib/python3.10/site-packages/yapf/pytree/pytree_utils.py", line 122, in ParseCodeToTree tree = parser_driver.parse_string(code, debug=False) File "/opt/conda/lib/python3.10/lib2to3/pgen2/driver.py", line 103, in parse_string return self.parse_tokens(tokens, debug) File "/opt/conda/lib/python3.10/lib2to3/pgen2/driver.py", line 71, in parse_tokens if p.addtoken(type, value, (prefix, start)): File "/opt/conda/lib/python3.10/lib2to3/pgen2/parse.py", line 119, in addtoken ilabel = self.classify(type, value, context) File "/opt/conda/lib/python3.10/lib2to3/pgen2/parse.py", line 175, in classify raise ParseError("bad token", type, value, context) lib2to3.pgen2.parse.ParseError: bad token: type=58, value='\x1b', context=('', (41, 7))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/conda/lib/python3.10/site-packages/yapf/yapflib/yapf_api.py", line 212, in FormatCode tree = pytree_utils.ParseCodeToTree(unformatted_source) File "/opt/conda/lib/python3.10/site-packages/yapf/pytree/pytree_utils.py", line 128, in ParseCodeToTree raise e File "/opt/conda/lib/python3.10/site-packages/yapf/pytree/pytree_utils.py", line 126, in ParseCodeToTree ast.parse(code) File "/opt/conda/lib/python3.10/ast.py", line 50, in parse return compile(source, filename, mode, flags, File "", line 41 MODELS= Registry of model

         ^

SyntaxError: invalid decimal literal

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/mnt/oneformer3d/tools/train.py", line 135, in main() File "/mnt/oneformer3d/tools/train.py", line 124, in main runner = Runner.from_cfg(cfg) File "/opt/conda/lib/python3.10/site-packages/mmengine/runner/runner.py", line 439, in from_cfg runner = cls( File "/opt/conda/lib/python3.10/site-packages/mmengine/runner/runner.py", line 380, in init self._log_env(env_cfg) File "/opt/conda/lib/python3.10/site-packages/mmengine/runner/runner.py", line 2324, in _log_env self.logger.info(f'Config:\n{self.cfg.pretty_text}') File "/opt/conda/lib/python3.10/site-packages/mmengine/config/config.py", line 892, in prettytext text, = FormatCode(text, style_config=yapf_style, verify=True) File "/opt/conda/lib/python3.10/site-packages/yapf/yapflib/yapf_api.py", line 215, in FormatCode raise errors.YapfError(errors.FormatErrorMsg(e)) yapf.yapflib.errors.YapfError: :41:10: invalid decimal literal

oneformer3d-contributor commented 7 months ago

SyntaxError is really strange. Did you make any modifications to our code?

ckzhkmk commented 7 months ago

SyntaxError is really strange. Did you make any modifications to our code?

I made no modifications.

oneformer3d-contributor commented 7 months ago

Even paths to files in the config? Looks like there is a syntax error in the s3dis config file, so yapf can not parse it...

ckzhkmk commented 7 months ago

Even paths to files in the config? Looks like there is a syntax error in the s3dis config file, so yapf can not parse it...

I replace all the config file and it fixed. Maybe there are sonme modifications before and i forgot it.Sorry for brother you so many times. Thank you very much.