szagoruyko / diracnets Goto Github PK
View Code? Open in Web Editor NEWTraining Very Deep Neural Networks Without Skip-Connections
Home Page: https://arxiv.org/abs/1706.00388
Training Very Deep Neural Networks Without Skip-Connections
Home Page: https://arxiv.org/abs/1706.00388
Hi, @soumith @szagoruyko
I want to input my own data in your diracNet.
Not a Cifar-10/Imagenet data but my own images data folder.
Like this code: http://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html
Is that possible?
Thanks in advance ~
Hi, Thank you for your code. But I am confused about the "i" implemented in your code. I think it may be different from what you said in your paper. In your paper, you initialize "I" as :
In some filters, there may be more than one weight initialized as 1. But in your code:
dirac_(I)
you used dirac_ function to initialize it. Only one element in a filter could be set 1. Maybe I misunderstand it. Could you please help me with it?
there are four files that you supply,but the last two files I can not download it.It display error message
how to download and install the torchnet module ? in sentence: import torchnet as tnt
The documentation mentions installing from a requirements.txt with pip install -r requirements.txt
but there's no requirements.txt present in this repository.
I run python train --help
, and get one error:
$ python train.py --help
File "train.py", line 166
z = {**vars(opt), **t}
^
SyntaxError: invalid syntax
How could I fix this error?
raceback (most recent call last):
File "train.py", line 230, in
main()
File "train.py", line 118, in main
f, params, stats = define_diracnet(opt.depth, opt.width, opt.dataset)
File "/home/amax/cqs/diracnets/diracnet.py", line 126, in define_diracnet
'conv': cast(kaiming_normal(torch.Tensor(widths[0], 3, 3, 3))),
TypeError: new() received an invalid combination of arguments - got (Tensor, int, int, int), but expected one of:
Hi, when I train the network, I got an error as followed:
recent call last):
File "train.py", line 230, in
main()
File "train.py", line 226, in main
engine.train(h, train_loader, opt.epochs, optimizer)
File "/home/jlin/anaconda2/envs/pytorch/lib/python2.7/site-packages/torchnet/engine/engine.py", line 63, in train
state['optimizer'].step(closure)
File "/home/jlin/anaconda2/envs/pytorch/lib/python2.7/site-packages/torch/optim/sgd.py", line 72, in step
loss = closure()
File "/home/jlin/anaconda2/envs/pytorch/lib/python2.7/site-packages/torchnet/engine/engine.py", line 52, in closure
loss, output = state'network'
File "train.py", line 162, in h
y = data_parallel(f, inputs, params, stats, sample[2], list(np.arange(opt.ngpu)))
File "/home/jlin/diracnets-master/diracnet.py", line 44, in data_parallel
return f(input, params, stats, mode)
File "/home/jlin/diracnets-master/diracnet.py", line 116, in f
o = group(o, params, stats, 'group0', mode, n * 2)
File "/home/jlin/diracnets-master/diracnet.py", line 94, in group
o = block(o, params, stats, '%s.block%d' % (base, i), mode, i)
File "/home/jlin/diracnets-master/diracnet.py", line 86, in block
w = beta * F.normalize(w.view(w.size(0), -1)).view_as(w) + alpha * delta
AttributeError: 'module' object has no attribute 'normalize'
And I view the file torch.nn.functional, where I could not find the functional named normalize. Did anyone meet the same problem ?
On ImageNet set, it occured as following:
File "train.py", line 245, in
main()
File "train.py", line 241, in main
engine.train(h, train_loader, opt.epochs, optimizer)
File "build/bdist.linux-x86_64/egg/torchnet/engine/engine.py", line 39, in train
File "/usr/local/lib/python2.7/dist-packages/torch/optim/sgd.py", line 72, in step
loss = closure()
File "build/bdist.linux-x86_64/egg/torchnet/engine/engine.py", line 28, in closure
File "train.py", line 177, in h
y = data_parallel(f, inputs, params, stats, sample[2], np.arange(opt.ngpu))
File "/home/yq/work/face_class/diracnets/diracnet.py", line 51, in data_parallel
return f(input, params, stats, mode)
File "/home/yq/work/face_class/diracnets/diracnet.py", line 182, in f
o = F.linear(o.view(o.size(0), -1), params['fc.weight'], params['fc.bias'])
File "/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py", line 449, in linear
return state(input, weight) if bias is None else state(input, weight, bias)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/functions/linear.py", line 10, in forward
output.addmm(0, 1, input, weight.t())
RuntimeError: cublas runtime error : library not initialized at /b/wheel/pytorch-src/torch/lib/THC/THCGeneral.c:394
Traceback (most recent call last):
File "train.py", line 231, in
main()
File "train.py", line 227, in main
engine.train(h, train_loader, opt.epochs, optimizer)
File "/home/jlin/anaconda2/envs/pytorch/lib/python2.7/site-packages/torchnet/engine/engine.py", line 63, in train
state['optimizer'].step(closure)
File "/home/jlin/anaconda2/envs/pytorch/lib/python2.7/site-packages/torch/optim/sgd.py", line 72, in step
loss = closure()
File "/home/jlin/anaconda2/envs/pytorch/lib/python2.7/site-packages/torchnet/engine/engine.py", line 56, in closure
self.hook('on_forward', state)
File "/home/jlin/anaconda2/envs/pytorch/lib/python2.7/site-packages/torchnet/engine/engine.py", line 31, in hook
self.hooksname
File "train.py", line 180, in on_forward
meter_loss.add(float(state['loss']))
TypeError: float() argument must be a string or a number
When I train the network, I met a error like that. Did anyone have meet the same problem, and how to solve it?
AttributeError: 'module' object has no attribute 'normalize'
File "/home/yq/work/face_class/diracnets/diracnet.py", line 97, in block
w = beta * F.normalize(w.view(w.size(0), -1)).view_as(w) + alpha * delta
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.