You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to run ICaRL with the code above (buffer_transform set to just None) but encountered an error because of my benchmark type (I think). The following is the error:
it was an error on the data type that pops when I start the training. End of the error says:
AttributeError: 'GenericCLScenario' object has no attribute 'n_classes_per_exp'
Is there a way to convert GenericCLScenario to NCScenario?
Thank you so much! I'm sorry for the long question. I used bold on the important words to help faster reading in case it's too long.
Cheers! Sorry for the trouble.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm trying to implement ICaRL on a custom dataset. So far I've successfully used the package for implementing LwF and EWC.
so far, this is how I prepare the dataset for training:
xtrainex = torch.tensor(xtrain1.values,dtype = torch.float32)
ytrainex = torch.tensor(ytrain1, dtype = torch.long)
xtestex = torch.tensor(xtest1.values,dtype = torch.float32)
ytestex = torch.tensor(ytest1, dtype = torch.long)
trainsetex = TensorDataset(xtrainex,ytrainex)
testsetex = TensorDataset(xtestex, ytestex)
trainex = make_classification_dataset(trainsetex,task_labels = 0)
testex = make_classification_dataset(testsetex,task_labels = 0)
=====================================================================
xtrainreal = torch.tensor(xtrain2.values,dtype = torch.float32)
ytrainreal = torch.tensor(ytrain2, dtype = torch.long)
xtestreal = torch.tensor(xtest2.values,dtype = torch.float32)
ytestreal = torch.tensor(ytest2, dtype = torch.long)
trainsetreal = TensorDataset(xtrainreal,ytrainreal)
testsetreal = TensorDataset(xtestreal, ytestreal)
trainreal = make_classification_dataset(trainsetreal, task_labels = 1)
testreal = make_classification_dataset(testsetreal, task_labels = 1)
=====================================================================
scenario_custom_task_labels = Generator.dataset_benchmark([trainex,trainreal],
[testex,testreal])
=====================================================================
eval_plugin = EvaluationPlugin(accuracy_metrics(minibatch=True, epoch=True, experience=True, stream=True),
loss_metrics(minibatch=True, epoch=True, experience=True, stream=True),
timing_metrics(epoch=True, epoch_running=True),
forgetting_metrics(experience=True, stream=True),
loggers=[interactive_logger, tb_logger]
)
cl_strategy = ICaRL(model.feature_extractor,
model.classifier,
optimizer=torch.optim.SGD(model.parameters(), lr=0.001, momentum=0.9),
device=device,
train_mb_size=64,
train_epochs=20,
eval_mb_size=64,
evaluator=eval_plugin,
memory_size = 32,
fixed_memory = False,
buffer_transform = None)
I have several questions as I'm quite new to continual learning.
"from avalanche.training import ICaRL" ---> when I try to implement this, I don't really understand how to fill out the buffer_transform parameter. Reading from the documentation https://avalanche-api.continualai.org/en/v0.3.1/generated/avalanche.training.ICaRL.html#avalanche.training.ICaRL, if I understood correctly, it says that it is the transformation that is applied to the buffer elements or the samples for Replay.
I tried to take a look here https://github.com/ContinualAI/avalanche/blob/master/examples/icarl.py and the parameter is filled with a function to transform the data. I don't use any kind of transformation for my data. Do you have any suggestions regarding what to fill if this is the case?
I tried to run ICaRL with the code above (buffer_transform set to just None) but encountered an error because of my benchmark type (I think). The following is the error:
it was an error on the data type that pops when I start the training. End of the error says:
AttributeError: 'GenericCLScenario' object has no attribute 'n_classes_per_exp'
Is there a way to convert GenericCLScenario to NCScenario?
Thank you so much! I'm sorry for the long question. I used bold on the important words to help faster reading in case it's too long.
Cheers! Sorry for the trouble.
Beta Was this translation helpful? Give feedback.
All reactions