- 🌍 I'm based in Switzerland 🇨🇭
My GitHub Stats
Top Repositories
pytorch-tiny-imagenet
"The dataset contains 100,000 images of 200 classes (500 for each class) downsized to 64×64 colored images. Each class has 500 training images, 50 validation images, and 50 test images." https://towardsdatascience.com/pytorch-ignite-classifying-tiny-imagenet-with-efficientnet-e5b1768e5e8f
According to this link, I think the dataset for validation is 10,000, but when I print the dataset it is about 5000.
dataset_sizes = {x: len(image_datasets[x]) for x in ['train', 'val', 'test']}
Hello and thank you for your example!
As your repository gets more popular I think it's important to say there's a typo in the code. For instance in file ResNet18_64.ipynb
this only changes variable in Linear instance but do not change the actual output size.
You have to recreate this layer, as shown in
https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_tutorial.html#resnet
#2 must be related to that
有几个问题想请教一下。
I download tiny imagenet in kaggle: https://www.kaggle.com/akash2sharma/tiny-imagenet
Run your code without any modificatoin, why Acc is very slow and hovering around 0.0053
Where did you download your dataset?
Could you share the trained model.
Hi, hope you're fine
I ran your code and it worked quite well : first run.sh then ResNet18_224.ipynb and finally ResNet18_FineTune.ipynb
I get the path files
The problem I have is that when I load the model weights, and I do y = model_ft(x) on an image from Tiny ImageNet, I get a probabilities/logits array of size 1000, and not 200 as expected.
Here is my code (strongly inspired by yours) :
model_ft = models.resnet18()
model_ft.conv1 = nn.Conv2d(3,64, kernel_size=(3,3), stride=(1,1), padding=(1,1), bias=False)
model_ft.maxpool = nn.Sequential()
model_ft.avgpool = nn.AdaptiveAvgPool2d(1)
model_ft.fc.out_features = 200
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model_ft = model_ft.to(device)
model_ft.load_state_dict(torch.load('./models/finetuned2/model_18_epoch.pt',
map_location=torch.device('cpu')))
path = 'tiny-imagenet-200/val/images/val_2342.JPEG'
x = plt.imread(path)
plt.imshow(x)
x = np.transpose(x, (2, 0, 1))
x.reshape((1, 3, 64, 64))
x = Variable(torch.from_numpy(x))
x = x.float()
x = x.view(1, 3, 64, 64)
model_ft.eval()
y = model_ft(x)
z = y.detach().numpy()
Any help is welcome, thanks a lot.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.