wvangansbeke / Unsupervised-Classification

SCAN: Learning to Classify Images without Labels, incl. SimCLR. [ECCV 2020]
https://arxiv.org/abs/2005.12320
Other
1.37k stars 268 forks source link

scan.py Error #116

Closed kkellyk closed 2 years ago

kkellyk commented 2 years ago

Hi, when I run !python scan.py --config_env configs/env.yml --config_exp configs/scan/scan_cifar10.yml find the Error:

{'setup': 'scan', 'criterion': 'scan', 'criterion_kwargs': {'entropy_weight': 5.0}, 'update_cluster_head_only': False, 'num_heads': 1, 'backbone': 'resnet18', 'train_db_name': 'cifar-10', 'val_db_name': 'cifar-10', 'num_classes': 10, 'num_neighbors': 20, 'augmentation_strategy': 'ours', 'augmentation_kwargs': {'crop_size': 32, 'normalize': {'mean': [0.4914, 0.4822, 0.4465], 'std': [0.2023, 0.1994, 0.201]}, 'num_strong_augs': 4, 'cutout_kwargs': {'n_holes': 1, 'length': 16, 'random': True}}, 'transformation_kwargs': {'crop_size': 32, 'normalize': {'mean': [0.4914, 0.4822, 0.4465], 'std': [0.2023, 0.1994, 0.201]}}, 'optimizer': 'adam', 'optimizer_kwargs': {'lr': 0.0001, 'weight_decay': 0.0001}, 'epochs': 50, 'batch_size': 128, 'num_workers': 8, 'scheduler': 'constant', 'pretext_dir': '/path/where/to/store/results/cifar-10/pretext', 'pretext_checkpoint': '/path/where/to/store/results/cifar-10/pretext/checkpoint.pth.tar', 'pretext_model': '/path/where/to/store/results/cifar-10/pretext/model.pth.tar', 'topk_neighbors_train_path': '/path/where/to/store/results/cifar-10/pretext/topk-train-neighbors.npy', 'topk_neighbors_val_path': '/path/where/to/store/results/cifar-10/pretext/topk-val-neighbors.npy', 'scan_dir': '/path/where/to/store/results/cifar-10/scan', 'scan_checkpoint': '/path/where/to/store/results/cifar-10/scan/checkpoint.pth.tar', 'scan_model': '/path/where/to/store/results/cifar-10/scan/model.pth.tar', 'selflabel_dir': '/path/where/to/store/results/cifar-10/selflabel', 'selflabel_checkpoint': '/path/where/to/store/results/cifar-10/selflabel/checkpoint.pth.tar', 'selflabel_model': '/path/where/to/store/results/cifar-10/selflabel/model.pth.tar'} Get dataset and dataloaders Files already downloaded and verified Traceback (most recent call last): File "scan.py", line 140, in main() File "scan.py", line 36, in main split='train', to_neighbors_dataset = True) File "/home/raru/Unsupervised-Classification/utils/common_config.py", line 154, in get_train_dataset indices = np.load(p['topk_neighbors_train_path']) File "/usr/local/lib/python3.6/dist-packages/numpy/lib/npyio.py", line 416, in load fid = stack.enter_context(open(os_fspath(file), "rb")) FileNotFoundError: [Errno 2] No such file or directory: '/path/where/to/store/results/cifar-10/pretext/topk-train-neighbors.npy'

I just download this code package, and run python simclr.py --config_env configs/your_env.yml --config_exp configs/pretext/simclr_cifar10.yml and python scan.py --config_env configs/your_env.yml --config_exp configs/scan/scan_cifar10.yml in README.md. Then there is an error. how should i solve it? Thanks. Kelly