- 同时调用keras和tensorflow出现问题,可能是版本不兼容,一些对应的版本:兼容版本
- 当cv2包出现问题ERROR: No matching distribution found for cv2,解决方法为安装opencv:安装方法
- tensorflow篇:
(1) python RuntimeError: tf.placeholder() is not compatible with eager execution.
错误行前输入tf.compat.v1.disable_eager_execution()
(2) AttributeError:module tensorflow no attribute app
将import tensorflow as tf 改为import tensorflow.compat.v1 as tf
(3) tensorflow在python3.10下使用pycharm安装出错
直接在该环境下输入pip install tensorflow
(4) “AttributeError: module ‘tensorflow’ has no attribute ‘random_uniform’”
It was moved to tf.random.uniform,将random_uniform改为random.uniform - pytorch安装篇
(1) mac下安装
(2) windows下安装 - umap包出现问题:AttributeError module umap has no attribute UMAP
要使用UMAP,需要安装umap-learn 而不是umap,可以
pip uninstall umap
pip install umap-learn
再调用umap时,不要再使用import umap,应当使用
import umap.umap_ as umap
另外,如果先使用import umap,再import umap.umap_ as umap也会有问题,直接调用import umap.umap_ as umap不会出错
6. Numpy和Tensor互相转换:可参考
7. AttributeError: ‘RandomOverSampler‘ object has no attribute ‘fit_sample‘:
把代码中的
from imblearn.over_sampling import RandomOverSampler
ROS = RandomOverSampler(random_state=0)
X_resampled, y_resampled = ROS.fit_sample(X, y)
fit_sample改为fit_resample
- NotWritableError: The current user does not have write permissions to a required path.解决方案
sudo chown -R xxx anaconda3
- PackagesNotFoundError: The following packages are not available from current channels python=2.7,解决办法
先查看是否有python2的版本
conda search -f python
有的话, 使用如下解决方案
conda create -c 'https://repo.continuum.io/pkgs/free/osx-64' -n py2 python=2.7