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

Issue with --lock-text Parameter in Bash Script #805

Open
Lylinnnnn opened this issue Jan 26, 2024 · 3 comments
Open

Issue with --lock-text Parameter in Bash Script #805

Lylinnnnn opened this issue Jan 26, 2024 · 3 comments

Comments

@Lylinnnnn
Copy link

Lylinnnnn commented Jan 26, 2024

Hello,

I am encountering an issue with the --lock-text parameter in my bash script. Below is the script I am using:

export CUDA_VISIBLE_DEVICES=0,1

torchrun --nproc_per_node 2 -m training.main \
    --save-frequency 2 \
    --train-data "medium_train_output_0104.csv" \
    --val-data "medium_test_output_0104.csv" \
    --pretrained "open_clip/open_clip_pytorch_model_b_32.bin" \
    --dataset-type "csv" \
    --batch-size 512 \
    --workers 8 \
    --lr 2e-4 \
    --wd 0.01 \
    --epochs 31 \
    --warmup 500 \
    --model ViT-B-32 \
    --force-image-size 224 \
    --report-to "tensorboard" \
    --log-every-n-steps 500 \
    --lr-scheduler const \
    --lock-text \
    --lock-image \
    --lock-image-unlocked-groups 6 \
    --lock-image-freeze-bn-stats

However, when I run this script, I encounter the following error:

2024-01-26,08:22:52 | INFO | Running in distributed mode with multiple processes. Device: cuda:1.Process (global: 1, local 1), total 2.
2024-01-26,08:22:52 | INFO | Loaded ViT-B-32 model config.
2024-01-26,08:22:52 | INFO | Running in distributed mode with multiple processes. Device: cuda:0.Process (global: 0, local 0), total 2.
2024-01-26,08:22:52 | INFO | Loaded ViT-B-32 model config.
2024-01-26,08:22:53 | INFO | Loading pretrained ViT-B-32 weights (/home/radiance/open_clip/open_clip_pytorch_model_b_32.bin).
2024-01-26,08:22:53 | INFO | Loading pretrained ViT-B-32 weights (/home/radiance/open_clip/open_clip_pytorch_model_b_32.bin).
Traceback (most recent call last):
  File "/home/radiance/.conda/envs/jarvis/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/radiance/.conda/envs/jarvis/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/radiance/open_clip/src/training/main.py", line 542, in <module>
    main(sys.argv[1:])
  File "/home/radiance/open_clip/src/training/main.py", line 297, in main
    model.lock_text_tower(
  File "/home/radiance/.conda/envs/jarvis/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1614, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'CLIP' object has no attribute 'lock_text_tower'

I am not sure why the lock_image parameter is causing this issue. Could you please give me a help?

@Lylinnnnn
Copy link
Author

Additionally, the --lock-image parameter is functioning normally.

@rwightman
Copy link
Collaborator

The issue is with --lock-text you mean? text locking needs support for the base model, see #523 ... that issue is almost working but think it needs a few changes, nobody has had the time to dig in

@Lylinnnnn Lylinnnnn changed the title Issue with --lock-image Parameter in Bash Script Issue with --lock-text Parameter in Bash Script Jan 27, 2024
@Lylinnnnn
Copy link
Author

Sorry for the confusion, I got it wrong earlier. I meant to refer to the issue with lock text. Thank you for your advice.

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

2 participants