/usr/local/Ascend/ascend-toolkit/latest/tools/ms_fmk_transplt/torch_npu_bridge/transfer_to_npu.py:129: ImportWarning:
*************************************************************************************************************
The torch.Tensor.cuda and torch.nn.Module.cuda are replaced with torch.Tensor.npu and torch.nn.Module.npu now..
The torch.cuda.DoubleTensor is replaced with torch.npu.FloatTensor cause the double type is not supported now..
The backend in torch.distributed.init_process_group set to hccl now..
The torch.cuda.* and torch.cuda.amp.* are replaced with torch.npu.* and torch.npu.amp.* now..
The device parameters have been replaced with npu in the function below:
torch.logspace, torch.randint, torch.hann_window, torch.rand, torch.full_like, torch.ones_like, torch.rand_like, torch.randperm, torch.arange, torch.frombuffer, torch.normal, torch._empty_per_channel_affine_quantized, torch.empty_strided, torch.empty_like, torch.scalar_tensor, torch.tril_indices, torch.bartlett_window, torch.ones, torch.sparse_coo_tensor, torch.randn, torch.kaiser_window, torch.tensor, torch.triu_indices, torch.as_tensor, torch.zeros, torch.randint_like, torch.full, torch.eye, torch._sparse_csr_tensor_unsafe, torch.empty, torch._sparse_coo_tensor_unsafe, torch.blackman_window, torch.zeros_like, torch.range, torch.sparse_csr_tensor, torch.randn_like, torch.from_file, torch._cudnn_init_dropout_state, torch._empty_affine_quantized, torch.linspace, torch.hamming_window, torch.empty_quantized, torch._pin_memory, torch.Tensor.new_empty, torch.Tensor.new_empty_strided, torch.Tensor.new_full, torch.Tensor.new_ones, torch.Tensor.new_tensor, torch.Tensor.new_zeros, torch.Tensor.to, torch.nn.Module.to, torch.nn.Module.to_empty
*************************************************************************************************************
warnings.warn(msg, ImportWarning)
Traceback (most recent call last):
File "/root/workspaces/pytorch-trans-demo/train.py", line 8, in <module>
from torch.utils.data import Dataset, DataLoader
File "<frozen importlib._bootstrap>", line 1064, in _handle_fromlist
File "/usr/local/Ascend/ascend-toolkit/latest/tools/ms_fmk_transplt/torch_npu_bridge/transfer_to_npu.py", line 134, in wrapped_isinstance
return torch_npu._isinstance(obj, class_or_tuple)
AttributeError: module 'torch_npu' has no attribute '_isinstance'
Exception ignored in atexit callback: <function dump_compile_times at 0xfffb0bd967a0>
Traceback (most recent call last):
File "/root/workspaces/mamba/envs/example/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 247, in dump_compile_times
log.info(compile_times(repr="str", aggregate=True))
File "/root/workspaces/mamba/envs/example/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 234, in compile_times
out += tabulate(rows, headers=("Function", "Runtimes (s)"))
File "/root/workspaces/mamba/envs/example/lib/python3.10/site-packages/torch/_dynamo/utils.py", line 86, in tabulate
import tabulate
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 945, in _find_spec
File "<frozen importlib._bootstrap_external>", line 1439, in find_spec
File "<frozen importlib._bootstrap_external>", line 1406, in _get_spec
File "/usr/local/Ascend/ascend-toolkit/latest/tools/ms_fmk_transplt/torch_npu_bridge/transfer_to_npu.py", line 134, in wrapped_isinstance
return torch_npu._isinstance(obj, class_or_tuple)
AttributeError: module 'torch_npu' has no attribute '_isinstance'
在使用PyTorch网络模型迁移和训练快速体验代码的时候,根据迁移修改代码后运行,提示如下错误
环境版本: