#853 ImportError: cannot import name 'remove_weight_norm' from 'mindtorch.torch.nn.utils'

Closed
created 1 year ago by zzc0208 · 1 comments
zzc0208 commented 1 year ago
### ImportError: cannot import name 'remove_weight_norm' from 'mindtorch.torch.nn.utils' (/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindtorch-0.2.1-py3.9.egg/mindtorch/torch/nn/utils/init.py) 遇到这个bug时使用的项目仓库:https://openi.pcl.ac.cn/zzc0208/so-vits-svc-npu ```shell (MindSpore) [root@fdc97ada29ea4fa3ac9ed51aed88e499-task0-0 so-vits-svc-npu]# python3 preprocess_hubert_f0.py --f0_predictor harvest --use_diff /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/jupyter_client/connect.py:22: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs given by the platformdirs library. To remove this warning and see the appropriate new directories, set the environment variable `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`. The use of platformdirs will be the default in `jupyter_core` v6 from jupyter_core.paths import jupyter_data_dir, jupyter_runtime_dir, secure_write /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/faiss/loader.py:28: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. if LooseVersion(numpy.__version__) >= "1.19": /home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/setuptools/_distutils/version.py:345: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. other = LooseVersion(other) Traceback (most recent call last): File "/home/ma-user/so-vits-svc-npu/preprocess_hubert_f0.py", line 19, in <module> from diffusion.vocoder import Vocoder File "/home/ma-user/so-vits-svc-npu/diffusion/vocoder.py", line 4, in <module> from vdecoder.nsf_hifigan.models import load_config, load_model File "/home/ma-user/so-vits-svc-npu/vdecoder/nsf_hifigan/models.py", line 9, in <module> from mindtorch.torch.nn.utils import remove_weight_norm, spectral_norm, weight_norm ImportError: cannot import name 'remove_weight_norm' from 'mindtorch.torch.nn.utils' (/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindtorch-0.2.1-py3.9.egg/mindtorch/torch/nn/utils/__init__.py) ```
Erpim commented 1 year ago
Collaborator
你好,感谢你的反馈。 remove_weight_norm在0.2分支上还未实现,所以无法调用。该接口已经在master分支实现,可以尝试通过源码安装的方式将mindtorch替换为最新版本。 pip uninstall mindtorch git clone https://git.openi.org.cn/OpenI/MSAdapter.git cd MSAdapter python setup.py install master分支部分功能mindspore 2.3版本新开发特性,所以匹配mindspore 2.2.x版本有部分功能可能无法使用,当前识别到优化器接口有部分无法使用,暂未识别其他问题,后续有发现其他问题,欢迎留言讨论。
zzc0208 closed this issue 1 year ago
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.