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

'media_token_id' AttributeError #280

Open
olo126 opened this issue Nov 9, 2023 · 0 comments
Open

'media_token_id' AttributeError #280

olo126 opened this issue Nov 9, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@olo126
Copy link
Collaborator

olo126 commented Nov 9, 2023

I set up an environment following the installation instructions and am trying to run train.py with the default lm, opt-1.3b,

torchrun --nnodes=1 --nproc_per_node=2 train/train.py \
  --lm_path facebook/opt-1.3b \
  --tokenizer_path facebook/opt-30b \
  --model_family flamingo \
  --cross_attn_every_n_layers 4 \
  --dataset_resampled \
  --batch_size_laion 32 \
  --train_num_samples_laion 250000 \
  --loss_multiplier_laion 0.2 \
  --workers=2 \
  --run_name "test" \
  --num_epochs 100 \
  --laion_shards "/mmfs1/gscratch/efml/anasa2/eval_benchmark/coco_wds/{000..064}_{0000..00012}.tar" \
  --report_to_wandb

But I get the following error:

Traceback (most recent call last):
File "/mmfs1/gscratch/efml/olo126/open_flamingo/open_flamingo/train/train.py", line 450, in
main()
File "/mmfs1/gscratch/efml/olo126/open_flamingo/open_flamingo/train/train.py", line 430, in main
train_one_epoch(
File "/mmfs1/gscratch/efml/olo126/open_flamingo/open_flamingo/train/train_utils.py", line 81, in train_one_epoch
(input_ids == model.media_token_id).sum().item()
File "/mmfs1/gscratch/xlab/olo126/miniconda3/envs/openflamingo/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1614, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'DistributedDataParallel' object has no attribute 'media_token_id'

@olo126 olo126 added the bug Something isn't working label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants