I am using tensorflow for model training and IsaacGym with pytorch tensor for simulation.
When I run my python script using command line in terminal,
If tensorflow is imported before pytorch, it raises the error Segmentation fault (core dumped)
when I create pytorch tensor on GPU.
If pytorch is imported before tensorflow, it raises the error DNN library is not found
when calling deep learning-related functions.
But when I run the script using Vscode debugger even without breakpoint, everything works fine.
To confirm the problem is due to the conflict between tensorflow and pytorch,
I create a test.py
which has
import torch
import tensorflow as tf
b = tf.convert_to_tensor([1, 2, 3])
a = torch.tensor([1, 2, 3], device='cuda')
I got same results if change the order of pytorch and tensorflow when running through command line.
The version of tensorflow and pytorch I am using are
tensorflow : 2.13.0
pytorch: 1.13.1+cu117
The cuda version by nvidia-smi
is 12.2
I want to ask
1.why does the error happen only when running through command line in terminal and everything is fine is using Vscode debugger?
2.Is there any way to avoid this conflict error between tensorflow and pytorch.
Appreciate any ideas and help!