python - “LSTM”对象没有属性“_flat_weights_names”
问题描述
执行 iNltk 库时,出现错误。我有最新版本的 pytorch 和 torchvision。
'LSTM' object has no attribute '_flat_weights_names'
在重新搜索了一些博客后,有人建议将版本降级到 1.2 所以我尝试从https://pytorch.org/get-started/previous-versions/下面安装
pip install torch==1.2.0+cu92 torchvision==0.4.0+cu92 -f https://download.pytorch.org/whl/torch_stable.html
但是,得到错误
ERROR: Could not find a version that satisfies the requirement torch==1.2.0+cpu
ERROR: No matching distribution found for torch==1.2.0+cpu
此外,缺少 1.3.1 版本。
有人知道如何降级到 1.3.1 或 1.2.0 吗?
提前致谢
PD
解决方案
我尝试使用pip
,但这对我不起作用。conda
解决了这个问题。
首先设置conda
环境并激活它。iNLTK
使用pip
in安装conda
如下:
pip install inltk
删除作为iNLTK
.
pip uninstall torch
安装所需版本的 PyTorch。
conda install pytorch==1.3.0 -c pytorch
推荐阅读
- php - 仅找到主页
- windows - 格式化Windows 10后,“按文件类型选择默认应用程序”下不存在.srt文件类型,怎么办?
- javascript - php设置间隔php函数
- javascript - 警报发生在隐藏在 jquery 中的可见性之前
- python - 模拟骰子游戏的 Python 程序,两个玩家都由计算机控制
- github - 为 GitHub 拉取请求重置分支
- phpstorm - JSCS 在 PhpStorm 和 WebStorm 上找不到 jscs 文件
- ios - iOS Swift4 如何协调 T.Type 和 type(of:) 以将动态类类型作为函数参数传递?
- python - 创建python包时如何从子目录中读取文件
- javascript - React 中的 Axios 获取方法响应无法在我的博客应用程序中显示从 firebase 获取数据作为数组