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

Missing package versions #8

Open
iryna-burak opened this issue May 9, 2023 · 1 comment
Open

Missing package versions #8

iryna-burak opened this issue May 9, 2023 · 1 comment

Comments

@iryna-burak
Copy link

Hi Prof. Lu,

Thank you for providing the code for the experiments!

I'm trying to run the models on the Burgers' equation, but I get errors on the PyTorch and TF sides.

For example, when running FNO with PyTorch, something is wrong with Adam:

Traceback (most recent call last):
  File ".../deeponet-fno/src/burgers/fourier_1d.py", line 322, in <module>
    FNO_main(training_data_resolution, save_index)
  File ".../deeponet-fno/src/burgers/fourier_1d.py", line 225, in FNO_main
    optimizer.step()
  File ".../miniconda3/envs/fair-torch/lib/python3.11/site-packages/torch/optim/lr_scheduler.py", line 69, in wrapper
    return wrapped(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../miniconda3/envs/fair-torch/lib/python3.11/site-packages/torch/optim/optimizer.py", line 280, in wrapper
    out = func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
  File ".../miniconda3/envs/fair-torch/lib/python3.11/site-packages/torch/optim/optimizer.py", line 33, in _use_grad
    ret = func(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../miniconda3/envs/fair-torch/lib/python3.11/site-packages/torch/optim/adam.py", line 141, in step
    adam(
  File ".../miniconda3/envs/fair-torch/lib/python3.11/site-packages/torch/optim/adam.py", line 281, in adam
    func(params,
  File ".../miniconda3/envs/fair-torch/lib/python3.11/site-packages/torch/optim/adam.py", line 442, in _multi_tensor_adam
    device_grads = torch._foreach_add(device_grads, device_params, alpha=weight_decay)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: The size of tensor a (2) must match the size of tensor b (16) at non-singleton dimension 3

And when trying to run DeepONet-POD with TF, there is an error complaining about tf.Saver:

Traceback (most recent call last):
  File ".../deeponet-fno/src/burgers/deeponet_POD.py", line 131, in <module>
    main()
  File ".../deeponet-fno/src/burgers/deeponet_POD.py", line 122, in main
    model.compile(
  File ".../miniconda3/envs/fair-tf/lib/python3.9/site-packages/deepxde/utils/internal.py", line 22, in wrapper
    result = f(*args, **kwargs)
  File ".../miniconda3/envs/fair-tf/lib/python3.9/site-packages/deepxde/model.py", line 131, in compile
    self._compile_tensorflow_compat_v1(lr, loss_fn, decay, loss_weights)
  File ".../miniconda3/envs/fair-tf/lib/python3.9/site-packages/deepxde/model.py", line 158, in _compile_tensorflow_compat_v1
    self.saver = tf.train.Saver(max_to_keep=None)
  File ".../miniconda3/envs/fair-tf/lib/python3.9/site-packages/tensorflow/python/training/saver.py", line 934, in __init__
    self.build()
  File ".../miniconda3/envs/fair-tf/lib/python3.9/site-packages/tensorflow/python/training/saver.py", line 946, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File ".../miniconda3/envs/fair-tf/lib/python3.9/site-packages/tensorflow/python/training/saver.py", line 971, in _build
    raise ValueError("No variables to save")
ValueError: No variables to save

I believe it happens because of some updates in the frameworks. So could you please provide the exact versions of the packages you used to run the experiments?

Thank you!

Best,
Iryna

@lululxvi
Copy link
Member

  • For the FNO code, I don't remember which version I used. But you can check the published date of the code, and use the PyTorch version for that date.
  • For DeepONet, it seems that you use tf v1 backend. You need to use tf backend.

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