会员登录 立即注册

搜索

用Colab训练数字人

[复制链接]
崎山小鹿 发表于 2024-12-10 16:37:01 | 显示全部楼层 |阅读模式
崎山小鹿
2024-12-10 16:37:01 598 0 看全部
在Colab 上用MimicTalk训练数字人

脚本地址:
https://colab.research.google.co ... rollTo=OjU021Om659c

地址2
https://colab.research.google.co ... 46S2g3V?usp=sharing


能顺利安装mmcv和pytorch3d

Building wheels for collected packages: mmcv
  Building wheel for mmcv (setup.py) ... done
  Created wheel for mmcv: filename=mmcv-2.1.0-cp39-cp39-linux_x86_64.whl size=1322078 sha256=55fe258d3108ce4a73093be7e6accbd37780e35774b6912a61fd85cd0687fe06
  Stored in directory: /root/.cache/pip/wheels/eb/be/7a/1cbc064b54f14e1f1e5b9133bc0b7e416904b784e86b478e10
Successfully built mmcv
Installing collected packages: addict, tomli, termcolor, pyparsing, platformdirs, opencv-python, kiwisolver, importlib-resources, fonttools, cycler, contourpy, yapf, matplotlib, mmengine, mmcv
Successfully installed addict-2.4.0 contourpy-1.3.0 cycler-0.12.1 fonttools-4.55.3 importlib-resources-6.4.5 kiwisolver-1.4.7 matplotlib-3.9.3 mmcv-2.1.0 mmengine-0.10.5 opencv-python-4.10.0.84 platformdirs-4.3.6 pyparsing-3.2.0 termcolor-2.5.0 tomli-2.2.1 yapf-0.43.0
Collecting git+https://github.com/facebookresearch/pytorch3d.git@stable
  Cloning https://github.com/facebookresearch/pytorch3d.git (to revision stable) to /tmp/pip-req-build-r7ge5w39
  Running command git clone --filter=blob:none --quiet https://github.com/facebookresearch/pytorch3d.git /tmp/pip-req-build-r7ge5w39
  Running command git checkout -q 75ebeeaea0908c5527e7b1e305fbc7681382db47
  Resolved https://github.com/facebookresearch/pytorch3d.git to commit 75ebeeaea0908c5527e7b1e305fbc7681382db47
  Preparing metadata (setup.py) ... done
Collecting iopath (from pytorch3d==0.7.8)
  Downloading iopath-0.1.10.tar.gz (42 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: tqdm in /content/local/miniconda/envs/mimictalk/lib/python3.9/site-packages (from iopath->pytorch3d==0.7.8) (4.65.2)
Requirement already satisfied: typing_extensions in /content/local/miniconda/envs/mimictalk/lib/python3.9/site-packages (from iopath->pytorch3d==0.7.8) (4.9.0)
Collecting portalocker (from iopath->pytorch3d==0.7.8)
  Downloading portalocker-3.0.0-py3-none-any.whl.metadata (8.5 kB)
Downloading portalocker-3.0.0-py3-none-any.whl (19 kB)
Building wheels for collected packages: pytorch3d, iopath
  Building wheel for pytorch3d (setup.py) ... done
  Created wheel for pytorch3d: filename=pytorch3d-0.7.8-cp39-cp39-linux_x86_64.whl size=980119 sha256=55d70f0222733cde2c0e3e69ab5fb9530a994eaf4739e5746c353b3e6e2d249e
  Stored in directory: /tmp/pip-ephem-wheel-cache-thub4ums/wheels/d7/e2/25/51fb3f170ac9f43bf7d1bd4bdbf67e4a34104adc2ecfe5f62e
  Building wheel for iopath (setup.py) ... done
  Created wheel for iopath: filename=iopath-0.1.10-py3-none-any.whl size=31545 sha256=8e1071c6aac511e5e1d4c5483b8bf98653e35aa883e11767f47454c811576d83
  Stored in directory: /root/.cache/pip/wheels/c1/13/6d/441d8f2af76ee6d2a3e67eebb1d0c556fefcee0a8b32266a8e
Successfully built pytorch3d iopath
Installing collected packages: portalocker, iopath, pytorch3d
Successfully installed iopath-0.1.10 portalocker-3.0.0 pytorch3d-0.7.8

运行视频训练和推理前还是要修改源代码的

下面是修改方法:

Traceback (most recent call last):
  File "/content/local/miniconda/envs/mimictalk/MimicTalk/inference/mimictalk_infer.py", line 18, in <module>
    from utils.commons.hparams import hparams, set_hparams
ModuleNotFoundError: No module named 'utils'

在 inference/mimictalk_infer.py 和 inference/train_mimictalk_on_a_video.py文件中添加:
import sys
sys.path.append('./')  #将当前目录 (./) 添加到 Python 模块搜索路径中,使得可以导入当前目录下的模块。

===========================================

安装组件时遇到的问题:

Building wheels for collected packages: pyaudio
  Running command Building wheel for pyaudio (pyproject.toml)
  running bdist_wheel
  running build
  running build_py
  creating build/lib.linux-x86_64-cpython-39/pyaudio
  copying src/pyaudio/__init__.py -> build/lib.linux-x86_64-cpython-39/pyaudio
  running build_ext
  building 'pyaudio._portaudio' extension
  creating build/temp.linux-x86_64-cpython-39/src/pyaudio
  gcc -pthread -B /content/local/miniconda/envs/mimictalk/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /content/local/miniconda/envs/mimictalk/include -I/content/local/miniconda/envs/mimictalk/include -fPIC -O2 -isystem /content/local/miniconda/envs/mimictalk/include -fPIC -I/usr/local/include -I/usr/include -I/content/local/miniconda/envs/mimictalk/include/python3.9 -c src/pyaudio/device_api.c -o build/temp.linux-x86_64-cpython-39/src/pyaudio/device_api.o
  src/pyaudio/device_api.c:9:10: fatal error: portaudio.h: No such file or directory
      9 | #include "portaudio.h"
        |          ^~~~~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/gcc' failed with exit code 1
  error: subprocess-exited-with-error
  
  × Building wheel for pyaudio (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /content/local/miniconda/envs/mimictalk/bin/python /content/local/miniconda/envs/mimictalk/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpy328lh56
  cwd: /tmp/pip-install-1703o6g1/pyaudio_66d22200ef194f3986428a21635963fd
  Building wheel for pyaudio (pyproject.toml) ... error
  ERROR: Failed building wheel for pyaudio
Failed to build pyaudio
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyaudio)

问题出在安装 pyaudio 时无法找到 portaudio.h 文件,这个文件是 PyAudio 库所依赖的 PortAudio 库的头文件。以下是问题的原因和解决方法:
安装 portaudio 系统依赖
在安装 PyAudio 之前,您需要确保 PortAudio 库已安装。运行以下命令安装:

# 在 Colab 或 Linux 系统中安装 PortAudio
!apt-get install -y portaudio19-dev




===========================
WARNING: The following packages were previously imported in this runtime:
  [_distutils_hack,setuptools]
You must restart the runtime in order to use newly installed versions.

此警告表明,在当前的 Colab 运行时中已经加载了一些与新安装的包相关的模块(例如 setuptools 和 _distutils_hack),但这些模块是旧版本的。新安装的版本无法覆盖已经加载的旧模块,因此需要重启运行时以便使用新安装的包
天不生墨翟,万古如长夜!以墨运商,以商助墨。金双石科技长期招聘科技研发人才!微信:qishanxiaolu   电话:15876572365   公司:深圳市金双石科技有限公司
回复

使用道具 举报

  • 您可能感兴趣
您需要登录后才可以回帖 登录 | 立即注册 |

本版积分规则 返回列表

管理员给TA私信
以墨运商,以商助墨。

查看:598 | 回复:0

  • 在村子中央建立图书馆

    昨天成绩斐然,收获两栋漂亮海滨别墅,和一个高级瞭望塔,但同时损失惨重,村民损失九

    阅读:0|2024-12-22
  • 墨家小镇文化与经济

    文化建设: 墨家十要 旗帜: 八卦 双鱼戏水 经济建设: 麦田、 甘蔗田

    阅读:156|2024-12-20
  • 墨者的面具

    仿照三星堆的面具做头像

    阅读:151|2024-12-19
  • 从出生地前往墨家小镇集合

    装饰一下出生地 现在有路标了,通过路标让会员找到我们的村庄,一路要非常小心不

    阅读:239|2024-12-18
  • 墨家盾牌和武器

    盾牌上有墨家的标志,武器上也有墨家的特色

    阅读:231|2024-12-17
  • 安全的保险箱

    每个人都一个自己的箱子,只有自己能开启。且死亡不掉落! 对着一个上方没有红石导

    阅读:240|2024-12-17
  • 我的世界之墨家旗帜

    如何在我的世界里创建独特的旗帜呢? 将图片生成像素画 https://chuiliu.github.io/d

    阅读:295|2024-12-16
  • 给服务器增加组件

    给服务器增加组件,例如:墨家旗帜 租赁服务器如何使用mod? 答:目前我的世界纯净

    阅读:356|2024-12-15
  • 用手机玩墨山游侠

    用手机玩墨山游侠 各大应用市场都可以下载我的世界游戏,启动之后 选择【开始游戏】

    阅读:366|2024-12-15
  • 墨山游侠服务器开启

    在网易上开启创服之旅 服务器号:25744989 我们先用游戏版本:1.12.2 来测试,看

    阅读:478|2024-12-14
金双石科技,软件开发20年,技术行业领先,您的满意,就是我们的目标,认真负责,开拓进取,让成品物超所值
关于我们
公司简介
发展历程
联系我们
本站站务
友情链接
新手指南
内容审核
商家合作
广告合作
商家入驻
新闻合作

手机APP

官方微博

官方微信

联系电话:15876572365 地址:深圳市宝安区西乡街道宝民二路宝民花园 ( 粤ICP备2021100124号-1 ) 邮箱:qishanxiaolu@qq.com
QQ|Powered by Discuz! X3.5 © 2001-2024 Discuz! Team.
快速回复 返回顶部 返回列表