Skip to content

πŸ›[BUG]: Installation of Modulus-Sym on Google Colab: ValueError: mutable default <class 'modulus.sym.hydra.loss.NTKConf'> for field ntk is not allowed: use default_factoryΒ #223

@LoveCheeseHB

Description

@LoveCheeseHB

Version

Modulus 0.9.0 and 1.8.0 (?)

On which installation method(s) does this occur?

No response

Describe the issue

Hi Everyone!

I am trying to use Modulus-Sym in conjunction with Google Colab with NVIDIA A100-SXM4-40GB. I am using Python 3.9. I think I have installed Modulus-Sym, but it does not seem to be working. I am trying to run the following "Hello World" type of script to test functionality.

When I try to check:

import modulus.sym
print(modulus.sym.version)

I get the following error:

import modulus.sym
print(modulus.sym.version)
8 frames
/usr/lib/python3.11/dataclasses.py in _get_field(cls, a_name, a_type, default_kw_only)
813 # not the instance.
814 if f._field_type is _FIELD and f.default.class.hash is None:
--> 815 raise ValueError(f'mutable default {type(f.default)} for field '
816 f'{f.name} is not allowed: use default_factory')
817

ValueError: mutable default <class 'modulus.sym.hydra.loss.NTKConf'> for field ntk is not allowed: use default_factory

Can you please direct me as to what I need to do to resolve this error? It is clear I am doing something wrong in basic installation! If someone can provide me the correct Google Colab setup instructions for Modulus-Sym, that would be fantastic!

Thank you!

Minimum reproducible example

import modulus.sym
print(modulus.sym.__version__)

Relevant log output

ValueError                                Traceback (most recent call last)
<ipython-input-12-03b1f6b627a0> in <cell line: 0>()
----> 1 import modulus.sym
      2 print(modulus.sym.__version__)

8 frames
/usr/lib/python3.11/dataclasses.py in _get_field(cls, a_name, a_type, default_kw_only)
    813     # not the instance.
    814     if f._field_type is _FIELD and f.default.__class__.__hash__ is None:
--> 815         raise ValueError(f'mutable default {type(f.default)} for field '
    816                          f'{f.name} is not allowed: use default_factory')
    817 

ValueError: mutable default <class 'modulus.sym.hydra.loss.NTKConf'> for field ntk is not allowed: use default_factory

Environment details

Google Colab
Python 3.9
NVIDIA A100-SXM4-40G
Modulus 0.9.0
Modulus-Sym ?

Other/Misc.

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingexternalIssues/PR filed by people outside the core team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions