D:\AI\anacon\lib\site-packages\torch\functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:3484.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
时间: 2023-07-30 22:12:27 浏览: 215
这是一个关于 PyTorch 库中的一个警告信息,提示未来版本中需要传入 indexing 参数。该警告信息是由于在 PyTorch 库中的 TensorShape.cpp 文件的某个部分触发的。meshgrid 函数是用于生成一个多维网格的函数,它的作用是将多个向量中的数据组合成一个网格,方便进行计算和可视化。如果你使用了该函数,需要注意参数传递的方式,具体可以查看 PyTorch 的官方文档。
相关问题
Found existing installation: pip 21.1.3 Uninstalling pip-21.1.3: Would remove: d:\anaconda\lib\site-packages\pip d:\anaconda\lib\site-packages\pip-21.1.3-py3.9.egg-info d:\anaconda\scripts\pip-script.py d:\anaconda\scripts\pip.exe d:\anaconda\scripts\pip3-script.py d:\anaconda\scripts\pip3.exe Proceed (y/n)?
此消息表示您已经安装了较旧版本的pip(21.1.3),并询问您是否要卸载该版本以进行更新。根据您的需求和情况,您可以选择继续卸载或取消卸载。
如果您想更新pip到最新版本,可以选择继续卸载。输入 "y" 并按下回车键确认卸载。
如果您不想更新pip或不确定是否应该卸载,请输入 "n" 并按下回车键取消卸载。
请根据您的需求进行选择。如果您有任何其他问题,请随时提问。
Traceback (most recent call last): File "D:/LPRNet_Pytorch-master/LPRNet_Pytorch-master/train_LPRNet.py", line 268, in <module> train() File "D:/LPRNet_Pytorch-master/LPRNet_Pytorch-master/train_LPRNet.py", line 107, in train lprnet.load_state_dict(torch.load(args.pretrained_model)) File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 608, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 787, in _legacy_load result = unpickler.load() File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 743, in persistent_load deserialized_objects[root_key] = restore_location(obj, location) File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 175, in default_restore_location result = fn(storage, location) File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 151, in _cuda_deserialize device = validate_cuda_device(location) File "D:\Anaconda\lib\site-packages\torch\serialization.py", line 135, in validate_cuda_device raise RuntimeError('Attempting to deserialize object on a CUDA ' RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device('cpu') to map your storages to the CPU.
这个错误是因为你在尝试从一个CUDA设备上加载模型,但是当前的机器上没有GPU。你需要使用`torch.load`函数时传入`map_location=torch.device('cpu')`的参数来将模型加载到CPU上。 例如:
```python
lprnet.load_state_dict(torch.load(args.pretrained_model, map_location=torch.device('cpu')))
```
阅读全文