Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot run codes due to missing files #4

Open
nidham-sony opened this issue Dec 18, 2023 · 3 comments
Open

[BUG] Cannot run codes due to missing files #4

nidham-sony opened this issue Dec 18, 2023 · 3 comments

Comments

@nidham-sony
Copy link
Contributor

nidham-sony commented Dec 18, 2023

This is the bug I get (I have downloaded all data and place it respectively in benchmark/images/Cifar_ori/ and benchmark/images/cifar100/)

(semsim) chgazagn@deatcs001fc106:~/sony/projects/SemSim$ python metrics/pixel_level_metrics.py
Setting up [LPIPS] perceptual loss: trunk [squeeze], v[0.1], spatial [off]
Loading model from: /home/EU/chgazagn/miniconda3/envs/semsim/lib/python3.8/site-packages/lpips/weights/v0.1/squeeze.pth
ResNet20-4_200_inversed_aug_auglist__rlabel_False
Traceback (most recent call last):
  File "metrics/pixel_level_metrics.py", line 156, in <module>
    results, results_positive, positive_item_rec, positive_item_ori= calculate_metrics(path_ori, path_rec)
  File "metrics/pixel_level_metrics.py", line 118, in calculate_metrics
    ori_ps = np.loadtxt(os.path.join(ori_dir+'_ps', name + ".txt"))
  File "/home/EU/chgazagn/miniconda3/envs/semsim/lib/python3.8/site-packages/numpy/lib/npyio.py", line 1338, in loadtxt
    arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
  File "/home/EU/chgazagn/miniconda3/envs/semsim/lib/python3.8/site-packages/numpy/lib/npyio.py", line 975, in _read
    fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
  File "/home/EU/chgazagn/miniconda3/envs/semsim/lib/python3.8/site-packages/numpy/lib/_datasource.py", line 193, in open
    return ds.open(path, mode, encoding=encoding, newline=newline)
  File "/home/EU/chgazagn/miniconda3/envs/semsim/lib/python3.8/site-packages/numpy/lib/_datasource.py", line 533, in open
    raise FileNotFoundError(f"{path} not found.")
FileNotFoundError: benchmark/images/cifar100/ResNet20-4_200_inversed_aug_auglist__rlabel_False_ori_ps/3_72.txt not found.

@sxzrt : can you make sure the file ResNet20-4_200_inversed_aug_auglist__rlabel_False_ori_ps/3_72.txt exist and inflate the zip ?

@nidham-sony nidham-sony changed the title [BUG] Cannot run pixel_level_metrics do to missing file [BUG] Cannot run codes due to missing files Dec 18, 2023
@nidham-sony
Copy link
Contributor Author

I also have this bug

(semsim) chgazagn@deatcs001fc106:~/sony/projects/SemSim$ python benchmark/Semsim_train_evaluation.py --data human_anno_id --arch ResNet18 --epochs 100 --mode crop --semsim True
Currently evaluating -------------------------------:
Monday, 18. December 2023 06:16PM
CPUs: 6, GPUs: 1 on deatcs001fc106.
GPU : NVIDIA RTX A4000
False
True
Currently evaluating -------------------------------:
Monday, 18. December 2023 06:16PM
CPUs: 6, GPUs: 1 on deatcs001fc106.
GPU : NVIDIA RTX A4000
Traceback (most recent call last):
  File "benchmark/Semsim_train_evaluation.py", line 288, in <module>
    main()
  File "benchmark/Semsim_train_evaluation.py", line 68, in main
    loss_fn, trainloader, validloader, _ = preprocess(opt, defs, valid=False)
  File "./benchmark/comm.py", line 370, in preprocess
    loss_fn, _, _, _ = inversefed.construct_dataloaders('human_anno_id', defs, opt.rec_data_dir, opt = opt)
  File "./inversefed/data/data_processing.py", line 47, in construct_dataloaders
    trainset, validset, recset = _build_human_anno_id(path, rec_data_dir, defs.augmentations, normalize, opt)
  File "./inversefed/data/data_processing.py", line 214, in _build_human_anno_id
    trainset = RE_ID_Tri_All_Data(data_path +  '/train_with_ori', transform=transforms.ToTensor())
  File "./inversefed/data/re_id_dataset_cross_tri.py", line 12, in __init__
    self.classes = sorted([d.name for d in os.scandir(root_dir) if d.is_dir()])
FileNotFoundError: [Errno 2] No such file or directory: '../../../data/human_anno_id/train_with_ori'

@nidham-sony
Copy link
Contributor Author

And similarly for test

(semsim) chgazagn@deatcs001fc106:~/sony/projects/SemSim$ python benchmark/Semsim_train_evaluation.py --data human_anno_id --arch ResNet18 --epochs 100 --mode crop --semsim True --evaluate True
Currently evaluating -------------------------------:
Monday, 18. December 2023 06:18PM
CPUs: 6, GPUs: 1 on deatcs001fc106.
GPU : NVIDIA RTX A4000
True
True
Currently evaluating -------------------------------:
Monday, 18. December 2023 06:18PM
CPUs: 6, GPUs: 1 on deatcs001fc106.
GPU : NVIDIA RTX A4000
Traceback (most recent call last):
  File "benchmark/Semsim_train_evaluation.py", line 276, in <module>
    feature_dis = evaluate_semsim()
  File "benchmark/Semsim_train_evaluation.py", line 190, in evaluate_semsim
    loss_fn, trainloader, validloader, reidloader = preprocess(opt, defs, valid=False)
  File "./benchmark/comm.py", line 370, in preprocess
    loss_fn, _, _, _ = inversefed.construct_dataloaders('human_anno_id', defs, opt.rec_data_dir, opt = opt)
  File "./inversefed/data/data_processing.py", line 47, in construct_dataloaders
    trainset, validset, recset = _build_human_anno_id(path, rec_data_dir, defs.augmentations, normalize, opt)
  File "./inversefed/data/data_processing.py", line 214, in _build_human_anno_id
    trainset = RE_ID_Tri_All_Data(data_path +  '/train_with_ori', transform=transforms.ToTensor())
  File "./inversefed/data/re_id_dataset_cross_tri.py", line 12, in __init__
    self.classes = sorted([d.name for d in os.scandir(root_dir) if d.is_dir()])
FileNotFoundError: [Errno 2] No such file or directory: '../../../data/human_anno_id/train_with_ori'

@nidham-sony
Copy link
Contributor Author

Moreover, the file metrics/data.txt is missing as I get this bug

(semsim) chgazagn@deatcs001fc106:~/sony/projects/SemSim$ python metrics/models_rank_corr.py 
Traceback (most recent call last):
  File "metrics/models_rank_corr.py", line 110, in <module>
    data = np.loadtxt('metrics/data.txt')
  File "/home/EU/chgazagn/miniconda3/envs/semsim/lib/python3.8/site-packages/numpy/lib/npyio.py", line 1338, in loadtxt
    arr = _read(fname, dtype=dtype, comment=comment, delimiter=delimiter,
  File "/home/EU/chgazagn/miniconda3/envs/semsim/lib/python3.8/site-packages/numpy/lib/npyio.py", line 975, in _read
    fh = np.lib._datasource.open(fname, 'rt', encoding=encoding)
  File "/home/EU/chgazagn/miniconda3/envs/semsim/lib/python3.8/site-packages/numpy/lib/_datasource.py", line 193, in open
    return ds.open(path, mode, encoding=encoding, newline=newline)
  File "/home/EU/chgazagn/miniconda3/envs/semsim/lib/python3.8/site-packages/numpy/lib/_datasource.py", line 533, in open
    raise FileNotFoundError(f"{path} not found.")
FileNotFoundError: metrics/data.txt not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant