hysts / pytorch_wrn Goto Github PK
View Code? Open in Web Editor NEWA PyTorch implementation of WRN
License: MIT License
A PyTorch implementation of WRN
License: MIT License
Hi, I'm trying to use WRN-28-10 using SAM on the SVHN dataset (10 class classification) https://github.com/davda54/sam by changing the forward and backward to happen twice instead of one. I'm getting an error.
I called !python main.py --depth 28 --widening_factor 10 --outdir results on google colab.
Output:
[2021/04/03 21:50:06 main INFO] - {
"model_config": {
"arch": "wrn",
"depth": 28,
"base_channels": 16,
"widening_factor": 10,
"drop_rate": 0,
"input_shape": [
1,
3,
32,
32
],
"n_classes": 10
},
"optim_config": {
"epochs": 200,
"batch_size": 128,
"base_lr": 0.1,
"weight_decay": 0.0005,
"momentum": 0.9,
"nesterov": true,
"milestones": [
60,
120,
160
],
"lr_decay": 0.2
},
"data_config": {
"dataset": "SVHN"
},
"run_config": {
"seed": 17,
"outdir": "results",
"num_workers": 7,
"tensorboard": false
}
}
Files already downloaded and verified
Files already downloaded and verified
/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py:477: UserWarning: This DataLoader will create 7 worker processes in total. Our suggested max number of worker in current system is 2, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
cpuset_checked))
[2021/04/03 21:50:11 main INFO] - n_params: 36479194
/usr/local/lib/python3.7/dist-packages/torch/nn/_reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.
warnings.warn(warning.format(ret))
[2021/04/03 21:50:11 main INFO] - Test 0
[2021/04/03 21:50:25 main INFO] - Epoch 0 Loss 2.3084 Accuracy 0.0967
[2021/04/03 21:50:25 main INFO] - Elapsed 13.65
/usr/local/lib/python3.7/dist-packages/torch/optim/lr_scheduler.py:134: UserWarning: Detected call of lr_scheduler.step()
before optimizer.step()
. In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step()
before lr_scheduler.step()
. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
"https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning)
[2021/04/03 21:50:25 main INFO] - Train 1
Traceback (most recent call last):
File "main.py", line 354, in
main()
File "main.py", line 334, in main
writer)
File "main.py", line 174, in train
loss = criterion(targets, model(data)) # use this loss for any training statistics
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/loss.py", line 1048, in forward
ignore_index=self.ignore_index, reduction=self.reduction)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py", line 2693, in cross_entropy
return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py", line 1672, in log_softmax
ret = input.log_softmax(dim)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
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.