Open jalman99 opened 9 months ago
Pytorch works for DeepONet, see example https://deepxde.readthedocs.io/en/latest/demos/operator/antiderivative_aligned.html, so it should work with MIONet. If not, this can be fixed easily by comparing the code of DeepONet and MIONet.
Hi, @jalman99 I meet the same problem using MIONet with pytorch backend. Have you figured out how to fix it?
No, sorry. It doesn't work without further efforts on the source code of MIONet, therefore I decided to use the tensorflow backend; even it has its drawbacks ...
No, sorry. It doesn't work without further efforts on the source code of MIONet, therefore I decided to use the tensorflow backend; even it has its drawbacks ...
Thanks a lot!
Make sure your data is float32.
Hi, there seems to be a bug in the implementation of MIONet within the pytorch backend. When running the basic MIONet example https://github.com/lu-group/mionet/blob/main/training/MIONet_training.py (e.g. on DR = Diffusion-reaction), the following error appears:
File ~\deepxde\deepxde\utils\internal.py:22 in wrapper result = f(*args, **kwargs)
File ~\deepxde\deepxde\model.py:631 in train self._test()
File ~\deepxde\deepxde\model.py:820 in _test ) = self._outputs_losses(
File ~\deepxde\deepxde\model.py:541 in _outputs_losses outs = outputs_losses(inputs, targets, auxiliary_vars)
File ~\deepxde\deepxde\model.py:316 in outputs_losses_train return outputs_losses(
File ~\deepxde\deepxde\model.py:298 in outputs_losses inputs = torch.as_tensor(inputs)
TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint8, and bool.
Any help or hints on this ?
Just switching to the tf.compat.v1 backend as simple solution is not a real alternative, since tensorflow's GPU access often confuses with the CUDA version that is installed on a given machine (Pytorch is more stable here).