Comments (7)
What is your batch size and how many samples do you have per epoch?
from adamwr.
OK, I figured it out. The bug happened in other place in my project. Thank you
from adamwr.
@mpyrozhok @reborm I have same error with "StopIteration" at same place. batch_size is 140 and 20580 samples each epoch
Any idea?
from adamwr.
@paulcx This can happen when you use some batch size and epoch size values while initializing scheduler and then supplying different values to your dataloader, or any other object that splits your epoch into batches and drives your training loop. You're trying to call scheduler more times per epoch than it is possible with batch size and epoch size values that you've supplied. times = samples_per_epoch // batch_size
from adamwr.
does it have to be exactly equal to this number? Can it be less?
from adamwr.
getting a new error:
TypeError Traceback (most recent call last)
in ()
1 training(model=model, epoch=20, eval_every=500,
2 loss_func=loss_function, optimizer=optimizer, train_iter=train_iter,
----> 3 val_iter=val_iter, scheduler=scheduler, warmup_epoch=3, early_stop=2)
in training(epoch, model, eval_every, loss_func, optimizer, train_iter, val_iter, scheduler, early_stop, warmup_epoch)
11
12 for e in range(epoch):
---> 13 scheduler.step()
14 #optimizer = exp_lr_scheduler(optimizer, e) #Added this line for learning rate decay
15 if e >= warmup_epoch:
in step(self)
270 self.last_epoch += 1
271 self.t_epoch += 1
--> 272 self._set_batch_size()
273 self.batch_step()
274
in _set_batch_size(self)
265 d, r = divmod(self.epoch_size, self.batch_size)
266 batches_in_epoch = d + 2 if r > 0 else d + 1
--> 267 self.batch_increment = iter(torch.linspace(0, 1, batches_in_epoch))
268
269 def step(self):
TypeError: 'generator' object is not callable
from adamwr.
does it have to be exactly equal to this number? Can it be less?
It will be a different scheduler then, probably. Could you elaborate on why do you need it to be less? And which parameters do you use while creating the scheduler? A brief explanation of your intentions and thoughts would also be helpful.
from adamwr.
Related Issues (8)
- LR Scheduler help HOT 1
- Add License HOT 1
- Getting Stop Iteration when running for training
- scheduler.batch_step() AttributeError: 'CosineLRWithRestarts' object has no attribute 'batch_increment' HOT 1
- Hypergradient Descent HOT 5
- Persisting CosineAnnealingLRWithRestarts HOT 2
- Lower/Upper Bound for LR and Upper Bound decay HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adamwr.