Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

pytorch doesn't import using pythonnet

Discussion in 'Formats & External Tools Previews' started by jaejun_sim, Dec 5, 2022.

  1. jaejun_sim

    jaejun_sim

    Joined:
    Nov 4, 2022
    Posts:
    1
    Hello
    i have a Issue for using pytorch with pythonnet

    First, I introduce my env.
    OS: windows10
    Unity version : 2019.4.24f1
    pythonnet version : 3.0.0.0
    cuda version : 10.1

    Second, Here is the Problem
    when i run python script(import torch) in empty unityproject, it is success
    but if i tried to run python script(import torch-gpu version) in my own unity project, it is fail

    and if i tried to run python script(import torch-cpu version) in my own unity project, it is success

    So i suspect that pytorch-gpu version can't load. but i need to load pytorch-gpu version for speed

    I wonder if some package or setting in Unity can make a crash when i load torch


    One more Thing is
    when i use python-unity with socket communication, python script(import torch-gpu version) run
     
  2. unity_28main28

    unity_28main28

    Joined:
    Feb 27, 2018
    Posts:
    1
    Hey, I'm trying to do something similar. Did you ever figure out how to get it to work?
     
  3. jacky2006211

    jacky2006211

    Joined:
    Jan 17, 2024
    Posts:
    1
    So does Python-Unity work well with Torch GPU version?