ngailapdi / lwf Goto Github PK
View Code? Open in Web Editor NEWImplementation of Learning without Forgetting paper
License: Apache License 2.0
Implementation of Learning without Forgetting paper
License: Apache License 2.0
I encounter the numpy memory error while trying to run the code.
My environment:
py3.10 , Torch 1.12.0 , numpy 1.26.1
I have 32GB memory,but the runnning process takes all of it.
Traceback (most recent call last):
File "D:\WORK\FaultDetection\LWF-master\main.py", line 37, in
all_train = cifar10(root='./data',
File "D:\WORK\FaultDetection\LWF-master\data_loader.py", line 45, in init
train_data.append(curr_img/255.)
numpy.core._exceptions.MemoryError: Unable to allocate 1.15 MiB for an array with shape (3, 224, 224) and data type float64
I tried to modify the data type of "curr_img" to float32, but the process failed.
Traceback (most recent call last):
File "D:\WORK\FaultDetection\LWF-master\main.py", line 37, in
all_train = cifar10(root='./data',
File "D:\WORK\FaultDetection\LWF-master\data_loader.py", line 51, in init
self.train_data = np.array(train_data, dtype = np.float32)
numpy.core._exceptions.MemoryError: Unable to allocate 28.0 GiB for an array with shape (50000, 3, 224, 224) and data type float32
What should I do to fix the problem?Should I change my Pytorch and Python to lower versions?
Thank you very much for your project, which has helped me a lot. But I have some questions about the definition of loss. line 152
Why do I need to recopy the original model and forward
it. May I directly copy the value of logits
of line 149. Or, what are the advantages or disadvantages of doing this?
Maybe I have overlooked some parts of the paper and hope to get your help. Any suggestions may be of great help to me, thank you very much!
In the paper, they said that first they freeze shared and old parameters and train new parameters only. After that, they do joint-training.
But in your code I dont see freezing step.
Thank you.
Thanks for sharing. But when I implemented the method on my local dataset, the behaviour of the model is not ideal. It feels like that it didn't have any improvement. I'd appreciate it if you could give me some suggestions!
Hello, @ngailapdi, I am trying to reproduce the results, when I am executing the main.py its showing following errors after downloading data.
"RuntimeError: Dataset metadata file not found or corrupted. You can use download=True to download it"
请问您的程序是从一百个类分成50个任务吗,每次任务两类?还是怎样?我想把这一百类分成十个任务,做增量学习,您有什么建议吗?
Traceback (most recent call last):
File "C:/Users/Lenovo/Desktop/Learning-without-Forgetting-using-Pytorch-main/main.py", line 70, in
transform=train_transforms,
File "C:\Users\Lenovo\Desktop\Learning-without-Forgetting-using-Pytorch-main\dataset.py", line 16, in init
with open(os.path.join(self.root, 'images.txt')) as f:
FileNotFoundError: [Errno 2] No such file or directory: '~/CUB_200_2011\images.txt'
AttributeError: 'cifar100' object has no attribute 'train_data',how to solve it?
fatal: Not a valid object name HEAD
Traceback (most recent call last):
File "C:/Users/Lenovo/Desktop/代码-zy/LWF/6LWF-master/main.py", line 171, in
githash = subprocess.check_output(['git', 'describe', '--always'])
File "D:\Programs\Python\Python36\lib\subprocess.py", line 356, in check_output
**kwargs).stdout
File "D:\Programs\Python\Python36\lib\subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'describe', '--always']' returned non-zero exit status 128.
Excuse me, what should I do with this problem
Hi, thanks a lot for sharing this implementation. But I found the implementation of MultiClassCrossEntropy confusing. The things are two-fold:
Apologize if there is any mistake in my understanding, and thanks again for sharing the implementation!
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.