当前位置:网站首页>Reproduction process and problems of analog transformer (ICLR 2022 Spotlight)
Reproduction process and problems of analog transformer (ICLR 2022 Spotlight)
2022-07-01 23:28:00 【Mind regulating and alchemy】
The author recommends python3.6,pytorch 1.4
1. Environmental changes
Try installing pytorch 1.4 function , But the code will get stuck , And there's no mistake . The positioning error is :Anomaly-Transformer/model/attn.py
self.distances = torch.zeros((window_size, window_size)).cuda().cuda() Get stuck : as a result of Installed pytorch 1.4 Corresponding CUDA Version is 10.x, The power of calculation is sm_86,CUDA 10.x Highest support to sm_75, Therefore need CUDA 11.x To support sm_8.x.
So upgrade My environment python3.7, pytorch 1.12 , The graphics card 3080Ti, CUDA edition :11.3
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorchRun the training script again , An error again :
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [512, 25]], which is output 0 of AsStridedBackward0, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
solve : Comment out Anomaly-Transformer/solver.py One of the first .step():
# Minimax strategy
loss1.backward(retain_graph=True)
# self.optimizer.step()
loss2.backward()
self.optimizer.step()Reference resources :Why the optimizer.step() write twice? · Issue #8 · thuml/Anomaly-Transformer · GitHub
2. Congratulations ! Running successfully !
python main.py --anormly_ratio 1 --num_epochs 3 --batch_size 128 --mode train --dataset PSM --data_path dataset/PSM --input_c 25 --output_c 25------------ Options -------------
anormly_ratio: 1.0
batch_size: 128
data_path: dataset/PSM
dataset: PSM
input_c: 25
k: 3
lr: 0.0001
mode: train
model_save_path: checkpoints
num_epochs: 3
output_c: 25
pretrained_model: None
win_size: 100
======================TEST MODE======================
/opt/conda/lib/python3.7/site-packages/torch/nn/_reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.
warnings.warn(warning.format(ret))
Threshold : 0.002150955616962149
pred: (87800,)
gt: (87800,)
pred: (87800,)
gt: (87800,)
Accuracy : 0.9848, Precision : 0.9713, Recall : 0.9739, F-score : 0.9726
The results in the paper : about PSM Data sets
P: 96.91,R: 98.9, F1: 97.89
Recurring Recall Slightly lower . however Precision Slightly higher . The two need to be weighed . You can adjust the above Threshold : 0.002150955616962149 Balance the two .
边栏推荐
- Redis RDB快照
- Practical application and extension of plain framework
- Redis data types and application scenarios
- MySQL binlog cleanup
- 字典、哈希表、数组的概念
- 硅谷产品实战学习感触
- 2022年最佳智能家居开源系统:Alexa、Home Assistant、HomeKit生态系统介绍
- [applet] realize the left and right [sliding] list through the scroll view component
- 问题随记 —— file /usr/share/mysql/charsets/README from install of MySQL-server-5.1.73-1.glibc23.x86_64 c
- Li Kou today's question -241 Design priorities for operational expressions
猜你喜欢

What category does the Internet of things application technology major belong to

MySQL binlog cleanup

2022安全员-C证考试题模拟考试题库及模拟考试

Matplotlib common settings

2022 examination questions and online simulation examination for safety management personnel of hazardous chemical business units

Yoga27 multidimensional all-in-one computer with excellent appearance and high-end configuration

from pip._internal.cli.main import main ModuleNotFoundError: No module named ‘pip‘

How to display real-time 2D map after rviz is opened

【必会】BM41 输出二叉树的右视图【中等+】

ARP报文头部格式和请求流程
随机推荐
"35 years old, the boss of the company, with a monthly salary of 20000, give away takeout": the times abandoned you, not even saying goodbye
Notes on problems - /usr/bin/perl is needed by mysql-server-5.1.73-1 glibc23.x86_ sixty-four
ARP报文头部格式和请求流程
神经网络物联网的未来趋势与发展
Development trend and future direction of neural network Internet of things
Redis 主从同步
Li Kou today's question -241 Design priorities for operational expressions
Is it safe to choose mobile phone for stock trading account opening in Shanghai?
2021 RoboCom 世界机器人开发者大赛-高职组初赛
【微服务|Sentinel】sentinel整合openfeign
Zhongang Mining: it has inherent advantages to develop the characteristic chemical industry dominated by fluorine chemical industry
Current situation and future development trend of Internet of things
ShanDong Multi-University Training #3
flutter Unable to load asset: assets/images/888.png
What is mosaic?
纪念成为首个DAYUs200三方demo贡献者
Stm32f030f4 drives tim1637 nixie tube chip
问题随记 —— file /usr/share/mysql/charsets/README from install of MySQL-server-5.1.73-1.glibc23.x86_64 c
Future trend and development of neural network Internet of things
【必会】BM41 输出二叉树的右视图【中等+】