arunmallya / packnet Goto Github PK
View Code? Open in Web Editor NEWCode for PackNet: Adding Multiple Tasks to a Single Network by Iterative Pruning
Home Page: https://arxiv.org/abs/1711.05769
Code for PackNet: Adding Multiple Tasks to a Single Network by Iterative Pruning
Home Page: https://arxiv.org/abs/1711.05769
hello,
I run this command:
python main.py --mode eval --dataset cubs_cropped \
--loadname ../checkpoints/csf_0.75,0.75,-1_vgg16_0.5-nobias-nobn_1.pt
everything is ok, but test other model,
python main.py --mode eval --dataset cubs_cropped \
--loadname ../checkpoints/csf_0.75,0.75,-1_vgg16bn_0.5-nobias-nobn_1.pt
or
python main.py --mode eval --dataset cubs_cropped \
--loadname ../checkpoints/csf_0.75,0.75,-1_densenet121_0.5-nobias-nobn_1.pt
problem happened.
result = self.forward(*input, **kwargs)
File "pytorch_test/ijcai/packnet/src/networks.py", line 78, in forward
x = self.shared(x)
File "pytorch_test/env3/lib/python3.5/site-packages/torch/nn/modules/module.py",
result = self.forward(*input, **kwargs)
File "/home/linning/pytorch_test/env3/lib/python3.5/site-packages/torch/nn/modules/batchnorm.py", line 49,
self.training or not self.track_running_stats, self.momentum, self.eps)
AttributeError: 'BatchNorm2d' object has no attribute 'track_running_stats'
My PyTorch version is : 0.4.0, python version is 3.5
Could you help me fixed it, thank you! @arunmallya
I am new in this task and read your code briefly。
Does line 137 in src/prune.py : ' self.current_masks = self.previous_masks' should be 'self.current_masks = mask'?
Hello
Please, I have a problem concerning the optimization of YOLOX model by Pytorch Pruning (Global & Local)
I got the same inference time after the optimization, I don't understand why ?
is it that the prune model by Pytoch does not remove the tensors which have equal to 0 after the equalization or there is another thing
any help
thanks in advance
Hello, thank you very much for sharing. But I ran into some problems while running your code. I would really appreciate it if you could help me.
Python main. Py - mode eval - dataset cubs_cropped - loadname/home/qiuyu/packnet - master/checkpoints/csf_0,0.75, 75-1 _vgg16_0. 5 - nobias - nobn_1. Pt
In this code, the program appeared "killed" and then stopped running. I wonder if it was because of my computer configuration. I used i5 and gpu=2070. When you run this program, the computer gets really stuck.
This code, the program is reporting an error,
Traceback (most recent call last):
File "main.py", line 393, in
The main ()
File "main.py", line 377, in main
The save = True, savename = args. Save_prefix)
File "main.py", line 215, in train
Self. Do_epoch (epoch_idx, optimizer)
File "main.py", line 172, in do_epoch
For batch, label in TQDM (self.train_data_loader, desc='Epoch: %d '% (epoch_idx)):
The File "/ home/qiuyu/anaconda3 / envs/pytorch/lib/python3.6 / site - packages/TQDM _tqdm. Py", line 1017, in iter
For obj in iterable:
The File "/ home/qiuyu/anaconda3 / envs/pytorch/lib/python3.6 / site - packages/torch/utils/data/dataloader py", line 301, in iter
Return DataLoaderIter (self)
The File "/ home/qiuyu/anaconda3 / envs/pytorch/lib/python3.6 / site - packages/torch/utils/data/dataloader py", line 158, in init
Baron tart ()
The File "/ home/qiuyu/anaconda3 / envs/pytorch/lib/python3.6 / multiprocessing/process. Py", line 105, in the start
Self. _popen = self. _popen (self)
The File "/ home/qiuyu/anaconda3 / envs/pytorch/lib/python3.6 / multiprocessing/context. Py", line 223, in _Popen
Return _default_context. Get_context (). The Process. _Popen (process_obj)
The File "/ home/qiuyu/anaconda3 / envs/pytorch/lib/python3.6 / multiprocessing/context. Py", line 277, in _Popen
Return Popen (process_obj)
The File "/ home/qiuyu/anaconda3 / envs/pytorch/lib/python3.6 multiprocessing/popen_fork py", line 19, in init
Self. _launch (process_obj)
The File "/ home/qiuyu/anaconda3 / envs/pytorch/lib/python3.6 multiprocessing/popen_fork py", line 66, in _launch
The self. The pid = OS. The fork ()
OSError: [Errno 12] no allocate memory
What's the reason for this?
Looking forward to your reply. Thank you very much. @
Hi @arunmallya :
Running Platform: GoogleColab
Environment: Python3.6
torch==0.2.0.post3
torchvision==0.1.9
torchnet, tqdm
I have changed "raw_input()" to "input()" in network.py. When I try to run the program, the following error occurs.
Traceback (most recent call last):
File "main.py", line 393, in
main()
File "main.py", line 331, in main
model = ckpt['model']
KeyError: 'model'
The file structure below the project is the same as your GitHub commit, where the file structure in checkpoints is shown below.
The contents of the imagenet folder are shown below.
The files vgg16.pt, vgg16bn.pt, resnet50.pt, densenet121.pt were downloaded in the same environment with the following code.
vgg16 = torchvision.models.vgg16(pretrained=True)
torch.save(vgg16.state_dict(), "/content/drive/MyDrive/packnet/vgg16.pt").
The other model files are downloaded in the same way.
How should I fix this error? Is there a mistake in the way I download the model? Or is the problem with the network.py file?
One more question.
Is there a requirement for the order in which the .sh files are run? I am talking about the following .sh files.
run_all_baseline_finetuning.sh
run_all_lwf.sh
run_all_sequence.sh
Thanks
hi @arunmallya ,I try to run script
./scripts/run_lwf.sh csf ../checkpoints/imagenet/vgg16.pt 2,3
seems vgg16.pt file worked with pytorch 0.2.0.post3, and can download from
https://uofi.box.com/s/zap2p03tnst9dfisad4u0sfupc0y1fxt
is there any way to upgrade to newer pytorch version, such as pytorch 1.6
Thanks
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.