mmpretrain
mmpretrain copied to clipboard
[Bug]
Branch
main branch (mmpretrain version)
Describe the bug
(openmmlab) PS D:\Users\Administrator\Downloads\mmpretrain-main (1)\mmpretrain-main> python tools/analysis_tools/confusion_matrix.py
configs/resnet/resnet50_8xb16_cifar10.py https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_b16x8_cifar10_20210528-f54bfad9.pth --show
10/09 11:44:15 - mmengine - INFO -
System environment: sys.platform: win32 Python: 3.8.18 (default, Sep 11 2023, 13:39:12) [MSC v.1916 64 bit (AMD64)] CUDA available: False numpy_random_seed: 1615616313 MSVC: 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.35.32216.1 版 GCC: n/a PyTorch: 2.0.1 PyTorch compiling details: PyTorch built with:
-
C++ Version: 199711
-
MSVC 193431937
-
Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications
-
Intel(R) MKL-DNN v2.7.3 (Git Hash 6dbeffbae1f23cbbeae17adb7b5b13f1f37c080e)
-
OpenMP 2019
-
LAPACK is enabled (usually provided by MKL)
-
CPU capability usage: AVX2
-
Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CXX_COMPILER=C:/cb/pytorch_1000000000000/work/tmp_bin/sccache-cl.exe, CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj /FS -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_DISABLE_GPU_ASSERTS=OFF, TORCH_VERSION=2.0.1, USE_CUDA=0, USE_CUDNN=OFF, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON, USE_ROCM=OFF,
TorchVision: 0.15.2 OpenCV: 4.8.1 MMEngine: 0.8.5
Runtime environment: cudnn_benchmark: False mp_cfg: {'mp_start_method': 'fork', 'opencv_num_threads': 0} dist_cfg: {'backend': 'nccl'} seed: 1615616313 deterministic: False Distributed launcher: none Distributed training: False GPU number: 1
10/09 11:44:15 - mmengine - INFO - Config: auto_scale_lr = dict(base_batch_size=128) data_preprocessor = dict( mean=[ 125.307, 122.961, 113.8575, ], num_classes=10, std=[ 51.5865, 50.847, 51.255, ], to_rgb=False) dataset_type = 'CIFAR10' default_hooks = dict( checkpoint=dict(interval=1, type='CheckpointHook'), logger=dict(interval=100, type='LoggerHook'), param_scheduler=dict(type='ParamSchedulerHook'), sampler_seed=dict(type='DistSamplerSeedHook'), timer=dict(type='IterTimerHook'), visualization=dict(enable=False, type='VisualizationHook')) default_scope = 'mmpretrain' env_cfg = dict( cudnn_benchmark=False, dist_cfg=dict(backend='nccl'), mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0)) load_from = 'https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_b16x8_cifar10_20210528-f54bfad9.pth' log_level = 'INFO' model = dict( backbone=dict( depth=50, num_stages=4, out_indices=(3, ), style='pytorch', type='ResNet_CIFAR'), head=dict( in_channels=2048, loss=dict(loss_weight=1.0, type='CrossEntropyLoss'), num_classes=10, type='LinearClsHead'), neck=dict(type='GlobalAveragePooling'), type='ImageClassifier') optim_wrapper = dict( optimizer=dict(lr=0.1, momentum=0.9, type='SGD', weight_decay=0.0001)) param_scheduler = dict( by_epoch=True, gamma=0.1, milestones=[ 100, 150, ], type='MultiStepLR') randomness = dict(deterministic=False, seed=None) resume = False test_cfg = dict() test_dataloader = dict( batch_size=16, dataset=dict( data_root='data/cifar10/', pipeline=[ dict(type='PackInputs'), ], split='test', type='CIFAR10'), num_workers=2, sampler=dict(shuffle=False, type='DefaultSampler')) test_evaluator = dict(type='ConfusionMatrix') test_pipeline = [ dict(type='PackInputs'), ] train_cfg = dict(by_epoch=True, max_epochs=200, val_interval=1) train_dataloader = dict( batch_size=16, dataset=dict( data_root='data/cifar10', pipeline=[ dict(crop_size=32, padding=4, type='RandomCrop'), dict(direction='horizontal', prob=0.5, type='RandomFlip'), dict(type='PackInputs'), ], split='train', type='CIFAR10'), num_workers=2, sampler=dict(shuffle=True, type='DefaultSampler')) train_pipeline = [ dict(crop_size=32, padding=4, type='RandomCrop'), dict(direction='horizontal', prob=0.5, type='RandomFlip'), dict(type='PackInputs'), ] val_cfg = dict() val_dataloader = dict( batch_size=16, dataset=dict( data_root='data/cifar10/', pipeline=[ dict(type='PackInputs'), ], split='test', type='CIFAR10'), num_workers=2, sampler=dict(shuffle=False, type='DefaultSampler')) val_evaluator = dict(topk=(1, ), type='Accuracy') vis_backends = [ dict(type='LocalVisBackend'), ] visualizer = dict( type='UniversalVisualizer', vis_backends=[ dict(type='LocalVisBackend'), ]) work_dir = 'C:\Users\Administrator\AppData\Local\Temp\tmpa_h1eaj7'
10/09 11:44:16 - mmengine - INFO - Distributed training is not used, all SyncBatchNorm (SyncBN) layers in the model will be automatically reverted to BatchNormXd layers if they are used. 10/09 11:44:16 - mmengine - INFO - Hooks will be executed in the following order: before_run: (VERY_HIGH ) RuntimeInfoHook (BELOW_NORMAL) LoggerHook
before_train: (VERY_HIGH ) RuntimeInfoHook (NORMAL ) IterTimerHook (VERY_LOW ) CheckpointHook
before_train_epoch: (VERY_HIGH ) RuntimeInfoHook (NORMAL ) IterTimerHook (NORMAL ) DistSamplerSeedHook
before_train_iter: (VERY_HIGH ) RuntimeInfoHook (NORMAL ) IterTimerHook
after_train_iter: (VERY_HIGH ) RuntimeInfoHook (NORMAL ) IterTimerHook (BELOW_NORMAL) LoggerHook (LOW ) ParamSchedulerHook (VERY_LOW ) CheckpointHook
after_train_epoch: (NORMAL ) IterTimerHook (LOW ) ParamSchedulerHook (VERY_LOW ) CheckpointHook
before_val: (VERY_HIGH ) RuntimeInfoHook
before_val_epoch: (NORMAL ) IterTimerHook
before_val_iter: (NORMAL ) IterTimerHook
after_val_iter: (NORMAL ) IterTimerHook (NORMAL ) VisualizationHook (BELOW_NORMAL) LoggerHook
after_val_epoch: (VERY_HIGH ) RuntimeInfoHook (NORMAL ) IterTimerHook (BELOW_NORMAL) LoggerHook (LOW ) ParamSchedulerHook (VERY_LOW ) CheckpointHook
after_val: (VERY_HIGH ) RuntimeInfoHook
after_train: (VERY_HIGH ) RuntimeInfoHook (VERY_LOW ) CheckpointHook
before_test: (VERY_HIGH ) RuntimeInfoHook
before_test_epoch: (NORMAL ) IterTimerHook
before_test_iter: (NORMAL ) IterTimerHook
after_test_iter: (NORMAL ) IterTimerHook (NORMAL ) VisualizationHook (BELOW_NORMAL) LoggerHook
after_test_epoch: (VERY_HIGH ) RuntimeInfoHook (NORMAL ) IterTimerHook (BELOW_NORMAL) LoggerHook
after_test: (VERY_HIGH ) RuntimeInfoHook
after_run: (BELOW_NORMAL) LoggerHook
Loads checkpoint by http backend from path: https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_b16x8_cifar10_20210528-f54bfad9.pth
10/09 11:44:17 - mmengine - INFO - Load checkpoint from https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_b16x8_cifar10_20210528-f54bfad9.pth
10/09 11:45:09 - mmengine - INFO - Epoch(test) [100/625] eta: 0:04:32 time: 0.4446 data_time: 0.0018
10/09 11:45:54 - mmengine - INFO - Epoch(test) [200/625] eta: 0:03:25 time: 0.4341 data_time: 0.0019
10/09 11:46:37 - mmengine - INFO - Epoch(test) [300/625] eta: 0:02:32 time: 0.4276 data_time: 0.0018
10/09 11:47:21 - mmengine - INFO - Epoch(test) [400/625] eta: 0:01:43 time: 0.4322 data_time: 0.0017
10/09 11:48:06 - mmengine - INFO - Epoch(test) [500/625] eta: 0:00:57 time: 0.4598 data_time: 0.0020
10/09 11:48:51 - mmengine - INFO - Epoch(test) [600/625] eta: 0:00:11 time: 0.4585 data_time: 0.0018
10/09 11:49:03 - mmengine - INFO - Epoch(test) [625/625] confusion_matrix/result:
tensor([[958, 0, 11, 3, 4, 0, 1, 0, 18, 5],
[ 1, 982, 0, 0, 1, 0, 0, 0, 1, 15],
[ 11, 0, 948, 8, 10, 9, 8, 3, 3, 0],
[ 4, 1, 13, 898, 10, 54, 10, 4, 4, 2],
[ 2, 0, 6, 11, 967, 5, 4, 5, 0, 0],
[ 1, 2, 7, 53, 12, 920, 2, 2, 0, 1],
[ 0, 2, 8, 9, 2, 1, 976, 1, 0, 1],
[ 6, 0, 6, 10, 5, 12, 0, 960, 1, 0],
[ 12, 4, 3, 0, 0, 0, 0, 0, 975, 6],
[ 2, 13, 0, 3, 0, 0, 0, 0, 11, 971]])
data_time: 0.0151 time: 0.4566
Traceback (most recent call last):
File "D:\Users\Administrator\anaconda3\envs\openmmlab\lib\shutil.py", line 616, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\Users\Administrator\AppData\Local\Temp\tmpa_h1eaj7\20231009_114410\20231009_114410.log'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "D:\Users\Administrator\anaconda3\envs\openmmlab\lib\tempfile.py", line 802, in onerror _os.unlink(path) PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\Users\Administrator\AppData\Local\Temp\tmpa_h1eaj7\20231009_114410\20231009_114410.log'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tools/analysis_tools/confusion_matrix.py", line 108, in
Environment
(openmmlab) PS D:\Users\Administrator\Downloads\mmpretrain-main (1)\mmpretrain-main> python -c "import mmpretrain.utils;import pprint;pprint.pp(dict(mmpretrain.utils.collect_env()))" {'sys.platform': 'win32', 'Python': '3.8.18 (default, Sep 11 2023, 13:39:12) [MSC v.1916 64 bit ' '(AMD64)]', 'CUDA available': False, 'numpy_random_seed': 2147483648, 'MSVC': '用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.35.32216.1 版', 'GCC': 'n/a', 'PyTorch': '2.0.1', 'TorchVision': '0.15.2', 'OpenCV': '4.8.1', 'MMEngine': '0.8.5', 'MMCV': '2.0.1', 'MMPreTrain': '1.0.2+'}
Other information
I tried to draw the confusion matrix following the tutorial linked below but kept getting errors.
https://mmpretrain.readthedocs.io/zh_CN/latest/useful_tools/confusion_matrix.html