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

TypeError: pic should be PIL Image or ndarray. Got <class 'torch.Tensor'> #74

Open
kandeldeepak46 opened this issue Apr 28, 2024 · 2 comments

Comments

@kandeldeepak46
Copy link

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
}

image

Can somebody please help to resolve this issue.

Thank you!

@G-U-N
Copy link
Owner

G-U-N commented Apr 29, 2024

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.

@kandeldeepak46
Copy link
Author

kandeldeepak46 commented Apr 29, 2024

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
}

image

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

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