PyCIL
PyCIL copied to clipboard
TypeError: pic should be PIL Image or ndarray. Got <class 'torch.Tensor'>
Hi Contributors,
I am trying to reproduce the results of SSRE and FeTrIL on tiny-imagenet-200 datasets. But getting the following TypeError.
python main.py --config=./exps/fetril.json
These are my parameters
{
"prefix": "train",
"dataset": "imagenet1000",
"memory_size": 0,
"shuffle": true,
"init_cls": 10,
"increment": 20,
"model_name": "fetril",
"convnet_type": "resnet18",
"device": ["2"],
"seed": [1993],
"init_epochs": 200,
"init_lr" : 0.1,
"init_weight_decay" : 5e-4,
"epochs" : 50,
"lr" : 0.05,
"batch_size" : 128,
"weight_decay" : 5e-4,
"num_workers" : 8,
"T" : 10
}
Can somebody please help to resolve this issue.
Thank you!
These issues are mainly due to that I specified the data preprocessing in their method file for better performance on CIFAR. For example, line 50. Deleting them should fix these issues.
Thank you for your reply. Commenting on those lines worked for me.
Moreover,
Are you aware of this error? Whenever I am trying to simulate 10 tasks of 20 classes on each task as specified in the following params
{
"prefix": "train",
"dataset": "imagenet1000",
"memory_size": 0,
"shuffle": true,
"init_cls": 10,
"increment": 20,
"model_name": "fetril",
"convnet_type": "resnet18",
"device": ["2"],
"seed": [1993],
"init_epochs": 200,
"init_lr" : 0.1,
"init_weight_decay" : 5e-4,
"epochs" : 50,
"lr" : 0.05,
"batch_size" : 128,
"weight_decay" : 5e-4,
"num_workers" : 8,
"T" : 10
}
But Whenever I used larger initial classes as
{
"prefix": "train",
"dataset": "imagenet1000",
"memory_size": 0,
"shuffle": true,
"init_cls": 100,
"increment": 20,
"model_name": "fetril",
"convnet_type": "resnet18",
"device": ["2"],
"seed": [1993],
"init_epochs": 200,
"init_lr" : 0.1,
"init_weight_decay" : 5e-4,
"epochs" : 50,
"lr" : 0.05,
"batch_size" : 128,
"weight_decay" : 5e-4,
"num_workers" : 8,
"T" : 10
}
it works. Does it need to have larger initial classes? Am I missing something here? regarding the arguments of JSON file?
Thank you