Nvidia Modulus on Jupyter-lab: ipykernel_launcher.py: error: unrecognized arguments:

I copied the lid-driven cavity code and pasted it in a jupyter notebook in different cells without making any changes.

This part of code gives me an error.

if __name__ == '__main__':
    ctr = ModulusController(LDCSolver)
    ctr.run()
usage: ipykernel_launcher.py [-h] [--run_mode {solve,eval,plot_data}]
                             [--network_dir NETWORK_DIR]
                             [--initialize_network_dir INITIALIZE_NETWORK_DIR]
                             [--added_config_dir ADDED_CONFIG_DIR]
                             [--rec_results REC_RESULTS]
                             [--rec_results_cpu REC_RESULTS_CPU]
                             [--rec_results_freq REC_RESULTS_FREQ]
                             [--max_steps MAX_STEPS]
                             [--save_filetypes SAVE_FILETYPES] [--xla XLA]
                             [--inner_norm INNER_NORM]
                             [--outer_norm OUTER_NORM]
                             [--activation_fn ACTIVATION_FN]
                             [--layer_size LAYER_SIZE] [--nr_layers NR_LAYERS]
                             [--skip_connections SKIP_CONNECTIONS]
                             [--weight_norm WEIGHT_NORM]
                             [--adaptive_activations ADAPTIVE_ACTIVATIONS]
                             [--start_lr START_LR] [--end_lr END_LR]
                             [--decay_steps DECAY_STEPS]
                             [--decay_rate DECAY_RATE] [--beta1 BETA1]
                             [--beta2 BETA2] [--epsilon EPSILON] [--amp AMP]
ipykernel_launcher.py: error: unrecognized arguments: -f /lustrehome/home/s.1915438/.local/share/jupyter/runtime/kernel-11d0f9b4-52b4-43c1-9b91-324e20fa1541.json
An exception has occurred, use %tb to see the full traceback.

SystemExit: 2

How to resolve this issue?

You have to run in from the command line. So save as python file and then run the python file from the command line.

Yes that is how modulus is made to work. But I remember that SimNet used to work in Jupyter-lab flawlessly. I don’t know why Modulus doesn’t work in the same way.
See this example,

1 Like

I use in google colab. I just save as a seperate python file and the call it from the command line.

For example:

Hi sir! I am wondering if I can run Modulus on google colab since my PC does not have GPU that is compatible. May I ask what should I do for creating environment / dependencies in colab so that I can also run simulations like you do in your screenshot? Thank you so much!

Interesting.

You can connect to gpu in colab for free. Search it online.