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

orcale model load move from observer to exp #592

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

smilesun
Copy link
Collaborator

No description provided.

@smilesun
Copy link
Collaborator Author

Run poetry run python examples/api/jigen_dann_transformer.py
/home/runner/.cache/pypoetry/virtualenvs/domainlab-okngg5wM-py3.10/lib/python3.10/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and will be removed in 0.15, please use 'weights' instead.
  warnings.warn(
/home/runner/.cache/pypoetry/virtualenvs/domainlab-okngg5wM-py3.10/lib/python3.10/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and will be removed in 0.15. The current behavior is equivalent to passing `weights=ViT_B_16_Weights.IMAGENET1K_V1`. You can also use `weights=ViT_B_16_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
Downloading: "https://download.pytorch.org/models/vit_b_16-c86[7](https://github.com/marrlab/DomainLab/actions/runs/9909608348/job/27378044389?pr=592#step:6:8)db91.pth" to /home/runner/.cache/torch/hub/checkpoints/vit_b_16-c867db91.pth

  0%|          | 0.00/330M [00:00<?, ?B/s]
  0%|          | 1.22M/330M [00:00<00:31, 10.8MB/s]
  1%|          | 3.39M/330M [00:00<00:19, 17.4MB/s]
  2%|▏         | 6.09M/330M [00:00<00:15, 22.2MB/s]
  3%|▎         | 9.59M/330M [00:00<00:12, 27.7MB/s]
  4%|▍         | 14.0M/330M [00:00<00:09, 34.3MB/s]
  6%|▌         | 19.7M/330M [00:00<00:07, 42.7MB/s]
  [8](https://github.com/marrlab/DomainLab/actions/runs/9909608348/job/27378044389?pr=592#step:6:9)%|▊         | 26.[9](https://github.com/marrlab/DomainLab/actions/runs/9909608348/job/27378044389?pr=592#step:6:10)M/330M [00:00<00:05, 53.3MB/s]
 11%|█         | 36.2M/330M [00:00<00:04, 66.9MB/s]
 15%|█▍        | 48.0M/330M [00:00<00:03, 84.3MB/s]
 19%|█▉        | 63.0M/330M [00:01<00:02, 107MB/s] 
 25%|██▍       | 82.2M/330M [00:01<00:01, 135MB/s]
 31%|███       | 102M/330M [00:01<00:01, 154MB/s] 
 35%|███▌      | 117M/330M [00:01<00:01, 145MB/s]
 40%|████      | 133M/330M [00:01<00:01, 154MB/s]
 47%|████▋     | 157M/330M [00:01<00:01, 180MB/s]
 55%|█████▍    | 181M/330M [00:01<00:00, 201MB/s]
 62%|██████▏   | 205M/330M [00:01<00:00, 218MB/s]
 69%|██████▉   | 229M/330M [00:01<00:00, 227MB/s]
 76%|███████▋  | 252M/330M [00:01<00:00, 231MB/s]
 84%|████████▎ | 276M/330M [00:02<00:00, 238MB/s]
 91%|█████████ | 300M/330M [00:02<00:00, 242MB/s]
 98%|█████████▊| 325M/330M [00:02<00:00, 246MB/s]
[10](https://github.com/marrlab/DomainLab/actions/runs/9909608348/job/27378044389?pr=592#step:6:11)0%|██████████| 330M/330M [00:02<00:00, 152MB/s]
/home/runner/.cache/pypoetry/virtualenvs/domainlab-okngg5wM-py3.10/lib/python3.10/site-packages/torch/nn/_reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead.
  warnings.warn(warning.format(ret))

using device: cpu

reading domain: sun
list of subfolders ['dog', 'vehicle', 'flying', 'sofa', 'sapiens']
reading domain: labelme
list of subfolders ['husky', 'sit', 'bird', 'drive']
reading domain: caltech
list of subfolders ['mensch', 'hund', 'vogel', 'stuhl', 'auto']
/home/runner/.cache/pypoetry/virtualenvs/domainlab-okngg5wM-py3.10/lib/python3.10/site-packages/torchmetrics/utilities/prints.py:36: UserWarning: Metric `AUROC` will save all targets and predictions in buffer. For large datasets this may lead to large memory footprint.
  warnings.warn(*args, **kwargs)
reading domain: sun
list of subfolders ['dog', 'vehicle', 'flying', 'sofa', 'sapiens']
reading domain: labelme
list of subfolders ['husky', 'sit', 'bird', 'drive']
reading domain: caltech
list of subfolders ['mensch', 'hund', 'vogel', 'stuhl', 'auto']
b'7e6fa5d'
model name: mini_vlcs_te_caltech_apimodel_b7e6fa5d_2024md_07md_12_14_37_02_seed_0

 Experiment start at: 2024-07-12 14:37:02.167353
before training, model accuracy: 0.692307710647583
reading domain: sun
list of subfolders ['dog', 'vehicle', 'flying', 'sofa', 'sapiens']
reading domain: labelme
list of subfolders ['husky', 'sit', 'bird', 'drive']
reading domain: caltech
list of subfolders ['mensch', 'hund', 'vogel', 'stuhl', 'auto']
reading domain: sun
list of subfolders ['dog', 'vehicle', 'flying', 'sofa', 'sapiens']
reading domain: labelme
list of subfolders ['husky', 'sit', 'bird', 'drive']
reading domain: caltech
list of subfolders ['mensch', 'hund', 'vogel', 'stuhl', 'auto']
epoch: 1
---- Training Domain: 
scalar performance:
{'acc': 0.3529412, 'precision': 0.37192982, 'recall': 0.35573125, 'specificity': 0.35573125, 'f1': 0.34385964, 'auroc': 0.4[11](https://github.com/marrlab/DomainLab/actions/runs/9909608348/job/27378044389?pr=592#step:6:12)0672}
---- Validation: 
scalar performance:
{'acc': 0.47058824, 'precision': 0.49122807, 'recall': 0.49011856, 'specificity': 0.49011856, 'f1': 0.4631579, 'auroc': 0.55335975}
---- Test Domain (oracle): 
scalar performance:
{'acc': 0.84615386, 'precision': 0.8, 'recall': 0.9, 'specificity': 0.9, 'f1': 0.8194445, 'auroc': 0.9583334}
new oracle model saved
better model found
persisted
after epoch: 1,now: 2024-07-[12](https://github.com/marrlab/DomainLab/actions/runs/9909608348/job/27378044389?pr=592#step:6:13) 14:43:37.876501,epoch time: 0:06:35.709[14](https://github.com/marrlab/DomainLab/actions/runs/9909608348/job/27378044389?pr=592#step:6:15)8,used: 0:06:35.709148,model: mini_vlcs_te_caltech_apimodel_b7e6fa5d_2024md_07md_12_14_37_02_seed_0
working direcotry: /home/runner/work/DomainLab/DomainLab
Experiment finished at epoch: 2 with time: 0:06:35.709148 at 2024-07-12 14:43:37.876501
persisted model performance metric: 

scalar performance:
{'acc': 0.846[15](https://github.com/marrlab/DomainLab/actions/runs/9909608348/job/27378044389?pr=592#step:6:16)386, 'precision': 0.8, 'recall': 0.9, 'specificity': 0.9, 'f1': 0.8194445, 'auroc': 0.9583334}
Traceback (most recent call last):
  File "/home/runner/work/DomainLab/DomainLab/examples/api/jigen_dann_transformer.py", line 83, in <module>
    test_transformer()
  File "/home/runner/work/DomainLab/DomainLab/examples/api/jigen_dann_transformer.py", line 79, in test_transformer
    exp.execute(num_epochs=2)
  File "/home/runner/work/DomainLab/DomainLab/domainlab/exp/exp_main.py", line 101, in execute
    self.trainer.post_tr()
  File "/home/runner/work/DomainLab/DomainLab/domainlab/algos/trainers/a_trainer.py", line [19](https://github.com/marrlab/DomainLab/actions/runs/9909608348/job/27378044389?pr=592#step:6:20)3, in post_tr
    self.observer.after_all()
  File "/home/runner/work/DomainLab/DomainLab/domainlab/algos/observers/b_obvisitor.py", line 99, in after_all
    dict_2add = self.cal_oracle_perf()
  File "/home/runner/work/DomainLab/DomainLab/domainlab/algos/observers/b_obvisitor.py", line 1[20](https://github.com/marrlab/DomainLab/actions/runs/9909608348/job/27378044389?pr=592#step:6:21), in cal_oracle_perf
    return self.exp.cal_oracle_perf()
AttributeError: 'ObVisitor' object has no attribute 'exp'
Error: Process completed with exit code 1.

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

Successfully merging this pull request may close these issues.

1 participant