其他分享
首页 > 其他分享> > name ‘_C‘ is not defined(pytorch1.9.0在jupyter notebook上报错)

name ‘_C‘ is not defined(pytorch1.9.0在jupyter notebook上报错)

作者:互联网

NameError Traceback (most recent call last) in 1 from algorithms import Argparser ----> 2 from algorithms import Session 3 def main(): 4 print("main started") 5 args = Argparser.parse()

D:\git\stav\stav-rl\algorithms\Session.py in 12 13 ---> 14 from algorithms.Episode import Episode 15 from algorithms.Agent import Agent 16 import torch

D:\git\stav\stav-rl\algorithms\Episode.py in 1 author = 'Noam' 2 ----> 3 import torch 4 import numpy as np 5 import cv2

c:\anaconda3\envs\threadartrl\lib\site-packages\torch__init__.py in 84 from torch._C import * 85 ---> 86 all += [name for name in dir(C) 87 if name[0] != '' and 88 not name.endswith('Base')]

NameError: name '_C' is not defined

建议从pytorch官网的历史版本中下载1.9.0之前版本,实测1.4.0可以解决

标签:stav,py,jupyter,name,defined,torch,algorithms,import
来源: https://blog.csdn.net/weixin_44181203/article/details/120771394