AutoDL部署Wonder3D

AutoDL部署Wonder3D

AutoDL部署Wonder3D AutoDL部署Wonder3D Modified March 13, 2024 Code block Plain Text Copy git clone https://github.com/xxlong0/Wonder3D.git pip install r requirements.txt pip install git+https://github.com/NVlabs/tiny cuda nn/ subdirectory=bindings/torch 先跑一遍基础Usage,此时生成result.png图片说明生成六视图部分已经成功 Code block Python Copy Usage First clone the repo, and use the commands in the repo import torch import requests from PIL import Image import numpy as np from torchvision.utils import make grid, save image from diffusers import DiffusionPipeline only tested on diffusers[torch]==0.19.3, may have conflicts with newer versions of diffusers def load wonder3d pipeline(): pipeline = DiffusionPipeline.from pretrained( 'flamehaze1115/wonder3d v1.0', or use local checkpoint './ckpts' custom pipeline='flamehaze1115/wonder3d pipeline', torch dtype=torch.float16 ) enable xformers pipeline.unet.enable xformers memory efficient attention() if torch.cuda.is available(): pipeline.to('cuda:0') return pipeline pipeline = load wonder3d pipeline() Download an example image. cond = Image.open(requests.get("https://d.skis.ltd/nrp/sample data/lysol.png", stream=True).raw) The object should be located in the center and resized to 80% of image height. cond = Image.fromarray(np.array(cond)[:, :, :3]) Run the pipeline! images = pipeline(cond, num inference steps=20, output type='pt', guidance scale=1.0).images result = make grid(images, nrow=6, ncol=2, padding=0, value range=(0, 1)) save image(result, 'result.png') • 报错:Error caught was: No module named 'triton' • 解决:退出正在运行的程序,输入“pip install triton”下载 • 报错:"HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url...... • 解决:是代理问题,参照 [内部]云端部署ClashX操作需激活代理 它会下载并进行一系列操作,完成后会得到一个result.png 没有问题后,这一步会实现先生成六视图,然后基于六视图生成3D模型: Code block Plain Text Copy python gradio app recon.py 这一步会有一些报错,解决就没有问题了 这一步会得到一个webui链接,点开就可以玩了 (注意有一些错是在webui的generate3D中报的,也是解决就OK,留意终端报错) • 报错:ModuleNotFoundError: No module named 'fire' • 解决:pip3 install fire • 报错:ModuleNotFoundError: No module named 'streamlit' • 解决:pip install streamlit • 报错: No such file or directory: 'sam pt/sam vit h 4b8939.pth • 解决:手动下载:https://huggingface.co/spaces/abhishek/StableSAM/blob/main/sam vit h 4b8939.pth 并在Wonder3D文件夹下新建一个sam pt文件夹,将sam vit h 4b8939.pth放在该目录下 • 报错If this call came from a pb2.py file, your generated code is out of date and must be regenerated with protoc = 3.19.0. • 解决:pip3 install upgrade protobuf==3.20.1 参考:https://www.cnblogs.com/booturbo/p/16339195.html • 报错:ImportError: cannot import name 'builder' from 'google.protobuf.internal' (/root/miniconda3/lib/python3.8/site packages/google/protobuf/internal/ init .py) • 解决:pip3 install upgrade protobuf==3.20.1 参考:https://zhuanlan.zhihu.com/p/655935779 报错: pickle.UnpicklingError: invalid load key, '<'. 解决:模型文件没有下载完整 打开这里的 测试的小猫玩偶: 每次重新开启过程 如果有环境,首先激活环境: conda activate wonder3d 开启代理(参考 [内部]云端部署ClashX) 在Wonder3D文件路径下 python gradio app recon.py [[内部]云端部署ClashX](https://qa3dhma45mc.feishu.cn/wiki/QY4Uw4ByPiB2lkkcSntcBBannof) [[内部]云端部署ClashX](https://qa3dhma45mc.feishu.cn/wiki/QY4Uw4ByPiB2lkkcSntcBBannof) 先跑一遍基础Usage,此时生成result.png图片说明生成六视图部分已经成功 • 报错:Error caught was: No module named 'triton' • 解决:退出正在运行的程序,输入“pip install triton”下载 • 报错:"HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url...... • 解决:是代理问题,参照 [内部]云端部署ClashX操作需激活代理 [[内部]云端部署ClashX](https://qa3dhma45mc.feishu.cn/wiki/QY4Uw4ByPiB2lkkcSntcBBannof) 它会下载并进行一系列操作,完成后会得到一个result.png 没有问题后,这一步会实现先生成六视图,然后基于六视图生成3D模型: • 报错:ModuleNotFoundError: No module named 'fire' • 解决:pip3 install fire • 报错:ModuleNotFoundError: No module named 'streamlit' • 解决:pip install streamlit • 报错: No such file or directory: 'sam pt/sam vit h 4b8939.pth • 解决:手动下载:https://huggingface.co/spaces/abhishek/StableSAM/blob/main/sam vit h 4b8939.pth 并在Wonder3D文件夹下新建一个sam pt文件夹,将sam vit h 4b8939.pth放在该目录下 • 报错If this call came from a pb2.py file, your generated code is out of date and must be regenerated with protoc = 3.19.0. • 解决:pip3 install upgrade protobuf==3.20.1 参考:https://www.cnblogs.com/booturbo/p/16339195.html • 报错:ImportError: cannot import name 'builder' from 'google.protobuf.internal' (/root/miniconda3/lib/python3.8/site packages/google/protobuf/internal/ init .py) • 解决:pip3 install upgrade protobuf==3.20.1 参考:https://zhuanlan.zhihu.com/p/655935779 报错: pickle.UnpicklingError: invalid load key, '<'. 解决:模型文件没有下载完整 打开这里的 测试的小猫玩偶: 每次重新开启过程 如果有环境,首先激活环境: conda activate wonder3d 开启代理(参考 [内部]云端部署ClashX) [[内部]云端部署ClashX](https://qa3dhma45mc.feishu.cn/wiki/QY4Uw4ByPiB2lkkcSntcBBannof) 在Wonder3D文件路径下 python gradio app recon.py Wonder3D 效果更好 https://github.com/xxlong0/Wonder3D 这是一个粗糙的笔记,需要Ubuntu基础+1,@龚涛 获得具体指导, AutoDL环境 下载与环境部署(需挂代理) 这样就算激活虚拟环境了(所有操作都需要在激活虚拟环境的情况下进行!)

在 小宇宙note 阅读完整内容