Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'use default_factory' error on python 3.11 #134

Open
expenses opened this issue Oct 2, 2023 · 1 comment
Open

'use default_factory' error on python 3.11 #134

expenses opened this issue Oct 2, 2023 · 1 comment

Comments

@expenses
Copy link

expenses commented Oct 2, 2023

Hi, when I tried to run this initially I got the following error:

[Taichi] version 1.6.0, llvm 15.0.4, commit f1c6fbbd, linux, python 3.11.5
Traceback (most recent call last):
  File "/home/ashley/projects/taichi_3d_gaussian_splatting/gaussian_point_train.py", line 3, in <module>
    from taichi_3d_gaussian_splatting.GaussianPointTrainer import GaussianPointCloudTrainer
  File "/home/ashley/projects/taichi_3d_gaussian_splatting/taichi_3d_gaussian_splatting/GaussianPointTrainer.py", line 31, in <module>
    class GaussianPointCloudTrainer:
  File "/home/ashley/projects/taichi_3d_gaussian_splatting/taichi_3d_gaussian_splatting/GaussianPointTrainer.py", line 32, in GaussianPointCloudTrainer
    @dataclass
     ^^^^^^^^^
  File "/home/ashley/.pyenv/versions/3.11.5/lib/python3.11/dataclasses.py", line 1230, in dataclass
    return wrap(cls)
           ^^^^^^^^^
  File "/home/ashley/.pyenv/versions/3.11.5/lib/python3.11/dataclasses.py", line 1220, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ashley/.pyenv/versions/3.11.5/lib/python3.11/dataclasses.py", line 958, in _process_class
    cls_fields.append(_get_field(cls, name, type, kw_only))
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ashley/.pyenv/versions/3.11.5/lib/python3.11/dataclasses.py", line 815, in _get_field
    raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'taichi_3d_gaussian_splatting.GaussianPointCloudRasterisation.GaussianPointCloudRasterisation.GaussianPointCloudRasterisationConfig'> for field rasterisation_config is not allowed: use default_factory

This only occurs with python 3.11, 3.10 doesn't have any issues so it's not a deal-breaker.

@wanmeihuali
Copy link
Owner

I think @yanzhoupan has seen a similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants