首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >ModuleNotFoundError:没有名为“pytorch3d”的模块-简化的Disco扩散

ModuleNotFoundError:没有名为“pytorch3d”的模块-简化的Disco扩散
EN

Stack Overflow用户
提问于 2022-05-10 17:04:43
回答 2查看 1.2K关注 0票数 0

我今天运行了这个Google,一切都很好,但是最终我开始在设置环境中得到这些错误。我找不到解决办法。任何帮助将不胜感激,如果我需要提供更多信息,请告诉我。

下面是到colab的链接:Diffusion.ipynb

代码语言:javascript
运行
复制
 Google Drive already mounted.
✅ Disco Diffusion root path will be "/content/gdrive/MyDrive/disco-diffusion-1"
Google Colab detected.
 Pulling updates from GitHub...

M   download_models.sh
M   examples/docker/disco-file.sh
M   examples/docker/disco.sh
M   examples/docker/interactive.sh
M   examples/docker/unittest.sh
M   examples/linux/configfile.sh
M   examples/linux/simple.sh
Your branch is up to date with 'origin/main'.

Already up to date.

 Upgrading pyyaml...
 Installing pip requirements...
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-11-4fe875dbbe21> in <module>()
     70 # Import DD helper modules
     71 sys.path.append(PROJECT_DIR)
---> 72 import dd, dd_args
     73 
     74 # Unsure about these:

1 frames
/content/gdrive/MyDrive/disco-diffusion-1/disco_xform_utils.py in <module>()
      3 
      4 # import pytorch3dlite.pytorch3dlite as p3d
----> 5 from pytorch3d import renderer
      6 from midas import utils as midas_utils
      7 from PIL import Image

ModuleNotFoundError: No module named 'pytorch3d'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
--------------------------------------------------------------------------- ```
EN

回答 2

Stack Overflow用户

发布于 2022-05-10 21:38:17

我已经和回购(这里)的作者讨论了一个问题。

同时,打开“设置环境”单元格,并更新"if is_colab“下面的部分,如下所示:

代码语言:javascript
运行
复制
#Upgrade pyyaml if in Colab
if is_colab:
    print(f' checking out specific commit...')
    for cmd in ['git clean -df', f'git reset --hard 3fc1dddb043f7f814db49fe951b4abb7eebd22fd', f'git log -1']:
      gitresults = subprocess.run(f'{cmd}'.split(' '), stdout=subprocess.PIPE).stdout.decode("utf-8")
      print(f'{gitresults}')
    print(f' Upgrading pyyaml...')
    subprocess.run(f'pip install --upgrade pyyaml --quiet'.split(' '), stdout=subprocess.PIPE).stdout.decode("utf-8")
    print(f' Installing pip requirements...')
    subprocess.run(f'pip install -r colab-requirements.txt --quiet'.split(' '), stdout=subprocess.PIPE).stdout.decode("utf-8")

这样做是为了恢复最后一次提交,而最后一次提交似乎已经破坏了一些东西。

只要重新运行牢房(和后面的).对我来说很管用。

票数 1
EN

Stack Overflow用户

发布于 2022-05-11 00:42:38

现在修好了。谢谢你的报道!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72190401

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档