Python 没有名为“的模块”;熔合的;

Python 没有名为“的模块”;熔合的;,python,machine-learning,pytorch,Python,Machine Learning,Pytorch,正在尝试将此操作运行到toonify faces图像。正如预期的那样,该笔记本在google colab上运行得非常好,但在我尝试在本地conda环境下运行该笔记本时,我遇到了以下错误:“行后没有名为‘fused’的模块” from models.psp import pSp ImportError回溯(最近一次调用) 在里面 3. 4来自utils.common import tensor2im ---->5从models.psp导入psp 6从models.e4e导入e4e 7. ~\De

正在尝试将此操作运行到toonify faces图像。正如预期的那样,该笔记本在google colab上运行得非常好,但在我尝试在本地conda环境下运行该笔记本时,我遇到了以下错误:“行后没有名为‘fused’的模块”

from models.psp import pSp
ImportError回溯(最近一次调用)
在里面
3.
4来自utils.common import tensor2im
---->5从models.psp导入psp
6从models.e4e导入e4e
7.
~\Desktop\Toonification project\restyle encoder\models\psp.py in
6来自火炬进口公司
7.
---->8来自models.stylegan2.model导入生成器
9从configs.path\u config导入模型\u路径
10从models.encoders导入fpn_编码器、restyle_psp_编码器
中的~\Desktop\Toonification project\restyle encoder\models\stylegan2\model.py
5从torch.nn导入功能为F
6.
---->7从models.stylegan2.op导入FusedLeakyReLU、fused_leaky_relu、UpfirD2D
8.
9
~\Desktop\Toonification project\restyle encoder\models\stylegan2\op\\uuuu init\uuuuu.py in
---->1来自fused_act导入FusedLeakyReLU,fused_leaky_relu
2从.upfird2d导入upfird2d
~\Desktop\Toonification project\restyle encoder\models\stylegan2\op\fused\u act.py in
11来源=[
12 os.path.join(模块路径“fused\u bias\u act.cpp”),
--->13 os.path.join(模块路径“fused\u bias\u act\u kernel.cu”),
14     ],
15 )
加载中的~\Anaconda3\envs\Toonification\lib\site packages\torch\utils\cpp\u extension.py(名称、源代码、额外标签、额外标签、额外标签、额外包含路径、构建目录、详细、带有cuda、是python模块、是独立的、保持中间)
1089是python模块,
1090是独立的,
->1091 keep_中间体=keep_中间体)
1092
1093
~\Anaconda3\envs\Toonification\lib\site packages\torch\utils\cpp\u extension.py in\u jit\u compile(名称、源代码、额外的cflags、额外的cuda\cflags、额外的ldflags、额外的include\u路径、构建目录、verbose、带有cuda、是python\u模块、是独立的、保持中间)
1315返回\u获取\u执行\u路径(名称、构建\u目录)
1316
->1317返回\u从\u库导入\u模块\u(名称,build\u目录,is\u python\u模块)
1318
1319
~\Anaconda3\envs\Toonification\lib\site packages\torch\utils\cpp\u extension.py in\u从\u库导入\u模块(模块名称、路径为\u python\u模块)
1697 def_从_库导入_模块(模块名称、路径为_python_模块):
1698     # https://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path
->1699文件,路径,描述=imp.find_模块(模块名称,[path])
1700#加载后关闭.so文件。
1701号文件:
查找模块中的~\Anaconda3\envs\Toonification\lib\imp.py(名称、路径)
294断开#当断开内环时,断开外环。
295其他:
-->296 raise ImportError(_ERR_MSG.format(name),name=name)
297
298编码=无
ImportError:没有名为“fused”的模块
我不确定此错误是否与Pytork版本或使用的cuda版本有关。在这个帖子中也提出了同样的问题

系统架构:

  • 视窗10
  • AMD Ryzen 3 x64
康达环境:

  • Pytorch:1.8.1+cu101(cuda 10.1)
  • Python:3.7.1

请以文本形式发布您的错误回溯和相关代码@美元。我现在补充说
        ImportError                               Traceback (most recent call last)
    <ipython-input-9-7be9843e0dbc> in <module>
          3 
          4 from utils.common import tensor2im
    ----> 5 from models.psp import pSp
          6 from models.e4e import e4e
          7 

    ~\Desktop\Toonification project\restyle-encoder\models\psp.py in <module>
          6 from torch import nn
          7 
    ----> 8 from models.stylegan2.model import Generator
          9 from configs.paths_config import model_paths
         10 from models.encoders import fpn_encoders, restyle_psp_encoders

    ~\Desktop\Toonification project\restyle-encoder\models\stylegan2\model.py in <module>
          5 from torch.nn import functional as F
          6 
    ----> 7 from models.stylegan2.op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d
          8 
          9 

    ~\Desktop\Toonification project\restyle-encoder\models\stylegan2\op\__init__.py in <module>
    ----> 1 from .fused_act import FusedLeakyReLU, fused_leaky_relu
          2 from .upfirdn2d import upfirdn2d

    ~\Desktop\Toonification project\restyle-encoder\models\stylegan2\op\fused_act.py in <module>
         11     sources=[
         12         os.path.join(module_path, 'fused_bias_act.cpp'),
    ---> 13         os.path.join(module_path, 'fused_bias_act_kernel.cu'),
         14     ],
         15 )

    ~\Anaconda3\envs\Toonification\lib\site-packages\torch\utils\cpp_extension.py in load(name, sources, extra_cflags, extra_cuda_cflags, extra_ldflags, extra_include_paths, build_directory, verbose, with_cuda, is_python_module, is_standalone, keep_intermediates)
       1089         is_python_module,
       1090         is_standalone,
    -> 1091         keep_intermediates=keep_intermediates)
       1092 
       1093 

    ~\Anaconda3\envs\Toonification\lib\site-packages\torch\utils\cpp_extension.py in _jit_compile(name, sources, extra_cflags, extra_cuda_cflags, extra_ldflags, extra_include_paths, build_directory, verbose, with_cuda, is_python_module, is_standalone, keep_intermediates)
       1315         return _get_exec_path(name, build_directory)
       1316 
    -> 1317     return _import_module_from_library(name, build_directory, is_python_module)
       1318 
       1319 

    ~\Anaconda3\envs\Toonification\lib\site-packages\torch\utils\cpp_extension.py in _import_module_from_library(module_name, path, is_python_module)
       1697 def _import_module_from_library(module_name, path, is_python_module):
       1698     # https://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path
    -> 1699     file, path, description = imp.find_module(module_name, [path])
       1700     # Close the .so file after load.
       1701     with file:

    ~\Anaconda3\envs\Toonification\lib\imp.py in find_module(name, path)
        294         break  # Break out of outer loop when breaking out of inner loop.
        295     else:
    --> 296         raise ImportError(_ERR_MSG.format(name), name=name)
        297 
        298     encoding = None

    ImportError: No module named 'fused'