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

benchmark_with_validation stream removes attribute 'task_labels' #1632

Open
wang-xulong opened this issue Apr 2, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@wang-xulong
Copy link

wang-xulong commented Apr 2, 2024

🐛 Describe the bug
A clear and concise description of what the bug is.
I use benchmark_with_validation stream to get the train_stream and valid_stream. when I use the strategy training , the train_stream or valid_stream don't have attribute 'task_labels'.

"AttributeError: 'DatasetExperience' object has no attribute 'task_labels'"

I check the issue is that the generated streams( train_stream and valid_stream) belong to the EagerCLStream while the test_steam belongs to the NCStream. I infer that the EagerCLStream don't have the attribute 'task_labels'. So the training process cannot be executed.

🐜 To Reproduce

scenario = SplitCIFAR100(
        n_experiences=10,  # 10 incremental experiences
        return_task_id=True,  # add task labels
        seed=1,
        shuffle=True
    )

  scenario = benchmark_with_validation_stream(scenario, validation_size=0.25)
  train_stream = scenario.train_stream
  valid_stream = scenario.valid_stream
  test_stream = scenario.test_stream

strategy = EWC(
        model=model,
        optimizer=optimizer,
        criterion=criterion,
        train_mb_size=64,
        train_epochs=appr_args['epochs_max'],
        eval_mb_size=64,
        device=device,
        evaluator=eval_plugin,
        ewc_lambda=0.4,
        eval_every=1,
        plugins=[lr_scheduler_p]
    )

  # train and test loop
  for train_task in train_stream:
      strategy.train(train_task)                                  << error is here

🐝 Expected behavior
A clear and concise description of what you expected to happen.

    strategy.train(train_task)      can be performed successfully  
@wang-xulong wang-xulong added the bug Something isn't working label Apr 2, 2024
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

1 participant