当前位置:网站首页>Pycharm uses CONDA to call the remote server
Pycharm uses CONDA to call the remote server
2022-07-28 09:51:00 【@Little snail】
Catalog
- PyCharm How to delete items completely
- window Of powershell install conda Link remote , And create the environment
- 1、 ImportError: cannot import name ‘BatchNormalization‘ from ‘keras.layers.normalization‘
- 2、FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead. from pandas import MultiIndex, Int64Index
- 3、Error! C:\Users\18437\jupyterProjectsTotalNPL\ Fudan University Chinese text classification corpus .xlsx is not UTF-8 encodedSaving disabled.
- 4、SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
- 5、ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl.
- 6、tensorflow call GPU
- 7、Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.
- 8、 Douban mirror image Fast installation
- 9、pytorch install GPU
- 10、TensorFlow call GPU
- 11、 Configuration environment
- 12、 There is not enough video memory
- 13、tensorflow1 edition GPU
- 14、gitgit
PyCharm How to delete items completely
https://www.pycharm.com.cn/t/62
pycharm





home—>dll—>annacoda3—>bin—>python3.9
window Of powershell install conda Link remote , And create the environment
# Log on to remote
ssh user name @ website -p port
conda info -e
# Creating a virtual environment
conda create -n name_pycharm python=3.9# establish
conda activate name_pycharm# Activate
conda install jupyter# Just 、 Download Software in virtual environment
conda list# see
jupyter notebook# start-up
1、 ImportError: cannot import name ‘BatchNormalization‘ from ‘keras.layers.normalization‘
Version of the problem
Solution : take from keras.layers.normalization import BatchNormalization
Change to from keras.layers.normalization.batch_normalization_v1 import BatchNormalization
2、FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead. from pandas import MultiIndex, Int64Index
pip install --upgrade pandas
3、Error! C:\Users\18437\jupyterProjectsTotalNPL\ Fudan University Chinese text classification corpus .xlsx is not UTF-8 encodedSaving disabled.
resolvent :
Whether it's txt The file or csv The file has such a problem , The solution is the same :
** Right click on the file - Open it in Notepad - Save as - Notice the bottom of the window – choice UTF-8 Coding format - preservation .
**.
https://www.php.cn/topic/excel/455341.html#:~:text=excel%E8%AE%BE%E7%BD%AE%E6%88%90,%E5%9B%9E%E4%BF%9D%E5%AD%98%E6%96%87%E4%BB%B6%E5%8D%B3%E5%8F%AF%E3%80%82
4、SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated \UXXXXXXXX escape
https://www.cnblogs.com/rychh/p/9743864.html
There are three ways to summarize :
One : Replace with absolute path
func1("C:\\Users\\renyc")
Two : Explicitly declare that the string does not need to be escaped ( Add r)
func1(r"C:\Users\renyc")
3、 ... and : Use Linux The path of /
func1("C:/Users/renyc")
5、ImportError: Missing optional dependency ‘openpyxl’. Use pip or conda to install openpyxl.
pip install openpyxl
6、tensorflow call GPU
Environmental installation
First of all, I'll turn it on anaconda Inside Anaconda powershell prompt
# Create a virtual environment inside tensorflowMy
conda create -n tensorflowMy python=3.9
# Activate the virtual environment
conda activate tensorflowMy
# install cudatoolkit
conda install cudatoolkit -c conda-forge
# install cudnn
conda install cudnn -c conda-forge
# Download in the virtual environment tensorflow package
pip install tensorflow
# Download in the virtual environment keras package
pip install keras
Code calls
import os
import tensorflow as tf
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
gpus = tf.config.list_physical_devices("GPU")
# View using GPU still CPU:
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
# see GPU Usage rate : Execute at the terminal nvidia-smi
7、Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.
Through online search , This is generally due to GPU The cause of insufficient video memory , My solution is to reduce it directly batch_size Size , take batch_size The value of the original 16 Revised to 8, It can run normally
8、 Douban mirror image Fast installation
pip install -i https://pypi.douban.com/simple < Packages that need to be installed >
such as :
pip install -i https://pypi.douban.com/simple requests
tensorflow 2.5.0
pip install -i https://pypi.douban.com/simple grpcio==1.34.0
pip install -i https://pypi.douban.com/simple h5py==3.1.0
pip install -i https://pypi.douban.com/simple numpy==1.19.2
pip install -i https://pypi.douban.com/simple six==1.15.0
pip install -i https://pypi.douban.com/simple tensorflow-estimator==2.5.0
pip install -i https://pypi.douban.com/simple typing-extensions==3.7.4
pip install -i https://pypi.douban.com/simple wrapt==1.12.1
9、pytorch install GPU
python:3.8.5
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
(pytorch_envs) C:\Users\Fishc>python
Python 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.10.2'
>>>torch.cuda.is_available()
10、TensorFlow call GPU
Install in the virtual environment tensorflow2.9.0+keras2.9.0+cudnn8.2.1.32+cudatoolkit11.4.2+python3.9
First of all, I'll turn it on anaconda Inside Anaconda powershell prompt
Create a virtual environment inside tensorflowMy
conda create -n tensorflowMy python=3.6
Activate the virtual environment
conda activate tensorflowMy
pip install tensorflow-gpu==1.12.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
install cudatoolkit
conda install cudatoolkit -c conda-forge
install cudnn
conda install cudnn -c conda-forge
Download in the virtual environment tensorflow package
pip install tensorflow
Download in the virtual environment keras package
pip install keras
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '/gpu:0'
# The key to this sentence
import time
# View using GPU still CPU:
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
11、 Configuration environment
# Create an environment
conda create -n rebot python=3.6
conda activate rebot
# Installation package
# Upgrade instruction
python -m pip install --upgrade pip
conda install jupyter
pip install tornado==4.4.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install tensorflow==1.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
#(tensorflow 2.0 There will be no tensorflow.contrib)
pip list
12、 There is not enough video memory
import tensorflow as tf
import os
os.environ["CUDA_VISIBLE_DEVICES"] = '0' # Specify the first block GPU You can use
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.5 # The program can only occupy the specified space at most gpu50% Explicit memory of
config.gpu_options.allow_growth = True # The program requests memory on demand
sess = tf.Session(config = config)
13、tensorflow1 edition GPU
conda create -n robot python=3.6
conda activate robot
conda install jupyter
python -m pip install --upgrade pip
pip install tornado==4.4.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install tensorflow-gpu==1.12 -i https://pypi.tuna.tsinghua.edu.cn/simple
conda install cudatoolkit=9.0
conda install cudnn=7.3
pip install numpy==1.16.0
import tensorflow as tf
tf.test.is_gpu_available()
14、gitgit
Start using our and interface gitgit-lfs
If you need to create a model repository from the command line ( If you create a repository from a website , Then skip )
pip install huggingface_hub
Or use transformers-cli if you have transformers
huggingface-cli login
Log in using the same credentials as huggingface.co/join
Create a model repo from the CLI if needed
huggingface-cli repo create model_name
Clone the model locally
Make sure you have git-lfs installed
(https://git-lfs.github.com)
git lfs install
git clone https://huggingface.co/username/model_name
Then add , Submit and push weights , Word splitter and configuration
save files via `.save_pretrained()` or move them here
git add .
git commit -m "commit from $USER"
git push
then , Your model will be accessed through its identifier : user name /model_name
Anyone can load it from the code :
tokenizer = AutoTokenizer.from_pretrained("username/model_name")
model = AutoModel.from_pretrained("username/model_name")
边栏推荐
猜你喜欢

Machine learning (10) -- hypothesis testing and regression analysis

Seeing clearly is more important than walking fast, because you can go far only when you walk right

OSS直连上传-Rails服务实践

Pytorch deep learning practice lesson 9 multi classification problems (handwritten numeral MNIST)

极致通缩和永动机模型,将推动 PlatoFarm 爆发

MySQL master-slave architecture. After the master database is suspended and restarted, how can the slave database automatically connect to the master database

使用Xposed对软件进行破解

ECCV 2022 | 无需微调即可推广!基于配准的少样本异常检测框架

Introduction to shardingsphere's concept of sub database and sub table (2)

力扣376-摆动序列——贪心
随机推荐
Introduction to shardingsphere's concept of sub database and sub table (2)
Mock.js
今天和大家聊一聊mysql数据库的数据类型
SizeBasedTriggeringPolicy简介说明
WPF布局之控件随着窗口等比放大缩小,适应多分辨率满屏填充应用
Introduction to shardingsphere (I)
关于CLR GC调优的一些问题
Database core system
PlatoFarm几大创新经济模型,给予当下元宇宙市场的启发
数据库高级学习笔记--存储函数
可以伸缩的搜索栏,模仿华为应用市场
matlab基本操作
力扣376-摆动序列——贪心
C form application uses object binding DataGridView data binding
NTU Lin Xuantian's "machine learning cornerstone" problem solving and code implementation | [you deserve it]
极致通缩和永动机模型,将推动 PlatoFarm 爆发
学个锤子 | .Net零基础逆向教程 第三课(壳与作业)
数据库高级学习笔记--游标
SeekTiger生态通证STI 新进展,4月14日登录 ZB
C# 倒计时工具