大语言模型复现常见bug及解决方法
【项目一】https://github.com/deep-floyd/IF复现中的错误处理
【项目简介】
开源AI绘画扛把子,Stable Diffusion背后公司StabilityAI再放大招!
全新开源模型DeepFloyd IF,一下获星2千+并登上GitHub热门榜。
- DeepFloyd IF仍然基于扩散模型,但与之前的Stable Diffusion相比有两大不同。
- 负责理解文字的部分从OpenAI的CLIP换成了谷歌T5-XXL,结合超分辨率模块中额外的注意力层,获得更准确的文本理解。
- 负责生成图像的部分从潜扩散模型换成了像素级扩散模型。 也就是扩散过程不再作用于表示图像编码的潜空间,而是直接作用于像素。
详细介绍请参考【量子位】的介绍Stable Diffusion团队放大招!新绘画模型直出AI海报,实现像素级图像生成
项目地址:https://github.com/deep-floyd/IF
【安装】
安装CLIP卡住,或者报错
Collecting git+https://github.com/openai/CLIP.git
Cloning https://github.com/openai/CLIP.git to /tmp/pip-req-build-aksx1g0m
Running command git clone --filter=blob:none --quiet https://github.com/openai/CLIP.git /tmp/pip-req-build-aksx1g0m
【解决方法】
git clone git@github.com:openai/CLIP.git
cd CLIP
pip install .
【错误】1. bitsandbytes/libbitsandbytes_cpu.so: undefined symbol: cget_col_row_stats
【解决方法】
重新安装cudatoolkit
conda uninstall cudatoolkit -y
conda install cudatoolkit -y
【错误】2. TypeError: Descriptors cannot not be created directly
TypeError: Descriptors cannot not be created directly.
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.
If you cannot immediately regenerate your protos, some other possible workarounds are:
- Downgrade the protobuf package to 3.20.x or lower.
- Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
【解决方法】
pip install 'protobuf<=3.20.1' --force-reinstall