【求助】使用免费GPU计算实例尝试模型库中的大模型,报错:无法利用GPU,找不到模型文件

简介: 开启了免费GPU计算实例,但是报错。

开启了如下GPU的实例:
image.png

运行如下代码:

from modelscope import AutoModelForCausalLM, AutoTokenizer
import torch
torch.manual_seed(0)

path = 'OpenBMB/MiniCPM-2B-dpo-bf16'
tokenizer = AutoTokenizer.from_pretrained(path)
model = AutoModelForCausalLM.from_pretrained(path, torch_dtype=torch.bfloat16, device_map='cuda', trust_remote_code=True)

responds, history = model.chat(tokenizer, "山东省最高的山是哪座山, 它比黄山高还是矮?差距多少?", temperature=0.8, top_p=0.8)
print(responds)

得到如下执行日志:

2024-02-22 20:25:41,904 - modelscope - INFO - PyTorch version 2.1.2+cu121 Found.
2024-02-22 20:25:41,907 - modelscope - INFO - TensorFlow version 2.14.0 Found.
2024-02-22 20:25:41,909 - modelscope - INFO - Loading ast index from /mnt/workspace/.cache/modelscope/ast_indexer
2024-02-22 20:25:41,909 - modelscope - INFO - No valid ast index found from /mnt/workspace/.cache/modelscope/ast_indexer, generating ast index from prebuilt!
2024-02-22 20:25:41,967 - modelscope - INFO - Loading done! Current index file version is 1.12.0, with md5 509123dba36c5e70a95f6780df348471 and a total number of 964 components indexed
/opt/conda/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm
2024-02-22 20:25:43.223187: I tensorflow/core/util/port.cc:111] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-02-22 20:25:43.225595: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-22 20:25:43.263147: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:9342] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-02-22 20:25:43.263200: E tensorflow/compiler/xla/stream_executor/cuda/cuda_fft.cc:609] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-02-22 20:25:43.263228: E tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:1518] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-02-22 20:25:43.271228: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
2024-02-22 20:25:43.271779: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2024-02-22 20:25:44.177266: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Downloading: 100%|██████████| 0.99k/0.99k [00:00<00:00, 4.45MB/s]
Downloading: 100%|██████████| 9.54k/9.54k [00:00<00:00, 31.0MB/s]
Downloading: 100%|██████████| 113/113 [00:00<00:00, 1.00MB/s]
Downloading: 100%|██████████| 66.3k/66.3k [00:00<00:00, 8.84MB/s]
Downloading: 100%|██████████| 11.3k/11.3k [00:00<00:00, 36.5MB/s]
Downloading: 100%|██████████| 414/414 [00:00<00:00, 3.11MB/s]
Downloading: 100%|██████████| 5.92M/5.92M [00:00<00:00, 39.3MB/s]
Downloading: 100%|██████████| 1.90M/1.90M [00:00<00:00, 128MB/s]
Downloading: 100%|██████████| 1.11k/1.11k [00:00<00:00, 6.25MB/s]
2024-02-22 20:25:49,918 - modelscope - WARNING - Download interval is too small, use local cache
OSError: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory /mnt/workspace/.cache/modelscope/OpenBMB/MiniCPM-2B-dpo-bf16.

其中有两个错误:

  • 2024-02-22 20:25:43.271228: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.
  • OSError: Error no file named pytorch_model.bin, tf_model.h5, model.ckpt.index or flax_model.msgpack found in directory /mnt/workspace/.cache/modelscope/OpenBMB/MiniCPM-2B-dpo-bf16.
相关实践学习
在云上部署ChatGLM2-6B大模型(GPU版)
ChatGLM2-6B是由智谱AI及清华KEG实验室于2023年6月发布的中英双语对话开源大模型。通过本实验,可以学习如何配置AIGC开发环境,如何部署ChatGLM2-6B大模型。
相关文章
|
9月前
|
分布式计算 测试技术 Spark
科大讯飞开源星火化学大模型、文生音效模型
近期,科大讯飞在魔搭社区(ModelScope)和Gitcode上开源两款模型:讯飞星火化学大模型Spark Chemistry-X1-13B、讯飞文生音频模型AudioFly,助力前沿化学技术研究,以及声音生成技术和应用的探索。
757 2
|
8月前
|
人工智能 搜索推荐 程序员
当AI学会“跨界思考”:多模态模型如何重塑人工智能
当AI学会“跨界思考”:多模态模型如何重塑人工智能
1151 120
|
9月前
|
机器学习/深度学习 人工智能 自然语言处理
AI Compass前沿速览:Qwen3-Max、Mixboard、Qwen3-VL、Audio2Face、Vidu Q2 AI视频生成模型、Qwen3-LiveTranslate-全模态同传大模型
AI Compass前沿速览:Qwen3-Max、Mixboard、Qwen3-VL、Audio2Face、Vidu Q2 AI视频生成模型、Qwen3-LiveTranslate-全模态同传大模型
1184 13
AI Compass前沿速览:Qwen3-Max、Mixboard、Qwen3-VL、Audio2Face、Vidu Q2 AI视频生成模型、Qwen3-LiveTranslate-全模态同传大模型
|
9月前
|
自然语言处理 机器人 图形学
腾讯混元图像3.0正式开源发布!80B,首个工业级原生多模态生图模型
腾讯混元图像3.0,真的来了——开源,免费开放使用。 正式介绍一下:混元图像3.0(HunyuanImage 3.0),是首个工业级原生多模态生图模型,参数规模80B,也是目前测评效果最好、参数量最大的开源生图模型,效果可对…
1828 2
腾讯混元图像3.0正式开源发布!80B,首个工业级原生多模态生图模型
|
9月前
|
机器学习/深度学习 算法 数据可视化
从零开始训练推理模型:GRPO+Unsloth改造Qwen实战指南
推理型大语言模型兴起,通过先思考再作答提升性能。本文介绍GRPO等强化学习算法,详解其原理并动手用Qwen2.5-3B训练推理模型,展示训练前后效果对比,揭示思维链生成的实现路径。
1231 2
从零开始训练推理模型:GRPO+Unsloth改造Qwen实战指南
|
8月前
|
缓存 物联网 PyTorch
使用TensorRT LLM构建和运行Qwen模型
本文档介绍如何在单GPU和单节点多GPU上使用TensorRT LLM构建和运行Qwen模型,涵盖模型转换、引擎构建、量化推理及LoRA微调等操作,并提供详细的代码示例与支持矩阵。
2256 2
|
8月前
|
人工智能 并行计算 PyTorch
以Lama Cleaner的AI去水印工具理解人工智能中经常会用到GPU来计算的CUDA是什么? 优雅草-卓伊凡
以Lama Cleaner的AI去水印工具理解人工智能中经常会用到GPU来计算的CUDA是什么? 优雅草-卓伊凡
761 4
|
9月前
|
存储 人工智能 弹性计算
阿里云gpu云服务器收费价格,热门实例简介和最新按量、1个月、1年收费标准参考
在阿里云所有gpu云服务器实例规格中,计算型gn5、gn6i、gn6v、gn7i和最新推出的gn8is、gn8v-tee等实例规格是其中比较热门的gpu云服务器实例。阿里云gpu云服务器最新租用价格参考,适合AI推理/训练的16核60G+1张A10 24G显存(gn7i-c16g1.4xlarge),按量优惠价1.9/小时起。本文为大家展示阿里云gpu云服务器中gn5、gn6i等热门实例规格的主要性能和适用场景以及最新按量和1个月、1年收费标准,以供参考。

热门文章

最新文章