ms报错"ValueError: Please input the correct checkpoint

[技术干货-功能调试] ms报错"ValueError: Please input the correct checkpoint

## 1. 系统环境:
```
Hardware Environment(Ascend/GPU/CPU): ALL
Software Environment:
MindSpore version (source or binary): 1.7.0 & Earlier versions
Python version (e.g., Python 3.7.5): 3.7.6
OS platform and distribution (e.g., Linux Ubuntu 16.04): Ubuntu
GCC/Compiler version (if compiled from source):
```
## 2. python代码样例

```python
net = Net()
param_dict = load_checkpoint("error.ckpt")
```

## 3. 报错信息:
```
ValueError: For 'load_checkpoint', the checkpoint file: /home/error.ckpt does not exist, please check whether the 'ckpt_file_name' is correct.
```

## 4. 原因分析
报错信息为:加载checkpoint时,没有找到脚本中指定的文件。

加载checkpoint时,会去找`load_checkpoint`方法中`ckpt_file_name`参数指定的文件。

如果没有找到这个文件,会报ValueError错误。

## 5. 解决方法
报错信息中,会把指定文件的绝对路径打印出来,可以根据打印出的信息,查看系统上有没有这个文件。

## 6. 参考文档
checkpoint 用法可以参考: [保存与加载](https://www.mindspore.cn/docs/programming_guide/zh-CN/r1.6/save_and_load_models.html)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值