【课程预告及链接】
⏰今日课程:MMagic 代码课 (6月15日 周四)
【课程名称】MMagic 代码课
【课程链接】https://www.bilibili.com/video/BV1gM4y1n7vP/
【讲师介绍】张子豪 OpenMMLab算法工程师
【学习形式】录播+社群答疑
【作业布置】本次课程有作业,Github issue:https://github.com/open-mmlab/OpenMMLabCamp/issues/405。
Magic相关资料
OpenMMLab 生成模型+底层视觉+AIGC+多模态 算法库 MMagic
MMagic主页:https://github.com/open-mmlab/mmagic
代码教程:https://github.com/TommyZihao/MMagic_Tutorials
在AI启智平台运行前,每次必须做的事情就是配置pip的安装源为清华镜像,并下载两个静态库相关的配置,执行环境里面的每次开机必安装脚本即可
!pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
!apt -y install libgl1-mesa-glx
!apt-get -y update
!apt-get -y install libglib2.0-dev
!apt-get -y install wget
按照教程先安装magic,并检查安装成功
案例一:黑白照片上色
左边是原图,右边是结果
案例二:从magic中导入模块时,报错
· from mmagic.apis import MMagicInferencer ·
2023-06-13 19:48:59.925425: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-06-13 19:49:00.681498: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /environment/miniconda3/lib/python3.8/site-packages/cv2/../../lib64:
2023-06-13 19:49:00.681590: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /environment/miniconda3/lib/python3.8/site-packages/cv2/../../lib64:
2023-06-13 19:49:00.681598: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.