Comments (10)
Hello William,
I tried pytorch-lightning today and I noticed some errors (documentation outdated maybe)
First, the experiment seems to be required now. Some exemples still show it as optionnel.
from pytorch_lightning import Trainer
trainer = Trainer()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-794-1d6d5436d3c1> in <module>
1 from pytorch_lightning import Trainer
----> 2 trainer = Trainer()
TypeError: __init__() missing 1 required positional argument: 'experiment'
Second, It looks like there is some issues with the Experiment object
import os
from test_tube import Experiment
exp = Experiment(os.getcwd())
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-796-eb3933834600> in <module>
2 from test_tube import Experiment
3
----> 4 exp = Experiment(os.getcwd())
~/.local/share/virtualenvs/smartch/lib/python3.6/site-packages/test_tube/log.py in __init__(self, name, debug, version, save_dir, autosave, description, create_git_tag, rank, *args, **kwargs)
152 # set the tensorboardx log path to the /tf folder in the exp folder
153 logdir = self.get_tensorboardx_path(self.name, self.version)
--> 154 super().__init__(log_dir=logdir, *args, **kwargs)
155
156 # register on exit fx so we always close the writer
~/.local/share/virtualenvs/smartch/lib/python3.6/site-packages/torch/utils/tensorboard/writer.py in __init__(self, log_dir, comment, purge_step, max_queue, flush_secs, filename_suffix)
219 # and recreated later as needed.
220 self.file_writer = self.all_writers = None
--> 221 self._get_file_writer()
222
223 # Create default bins for histograms, see generate_testdata.py in tensorflow/tensorboard
~/.local/share/virtualenvs/smartch/lib/python3.6/site-packages/test_tube/log.py in _get_file_writer(self)
502
503 if self.all_writers is None or self.file_writer is None:
--> 504 if 'purge_step' in self.kwargs.keys():
505 most_recent_step = self.kwargs.pop('purge_step')
506 self.file_writer = FileWriter(logdir=self.log_dir, **self.kwargs)
AttributeError: 'Experiment' object has no attribute 'kwargs'
My versions are:
test-tube==0.6.7.6
pytorch-lightning==0.3.6.9
If there some problem on my side? Maybe you prefer if I open two separates issues?
Regards,
Robin
from lightning.
Experiment(save_dir=os.getcwd())
from lightning.
Experiment is required. it's just redundant to add it to every example in the documentation. it obscures the specific flag we're discussing in that documentation item
from lightning.
See the readme for a full working example:
https://github.com/williamFalcon/pytorch-lightning#how-do-i-do-use-it
from lightning.
but yeah, maybe the experiment argument can be optional
from lightning.
Thank for your answer.
It's indeed the code that I tested, I just forgot to add the 'save_dir=' in the test I copy/pasted here as it was ommited in the test-tube documentation : exp = Experiment('/some/path')
here https://github.com/williamFalcon/test-tube.
With the correction, the error stays the same.
exp = Experiment(save_dir=os.getcwd())
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-804-b3fb304b7766> in <module>
----> 1 exp = Experiment(save_dir=os.getcwd())
~/.local/share/virtualenvs/smartch/lib/python3.6/site-packages/test_tube/log.py in __init__(self, name, debug, version, save_dir, autosave, description, create_git_tag, rank, *args, **kwargs)
152 # set the tensorboardx log path to the /tf folder in the exp folder
153 logdir = self.get_tensorboardx_path(self.name, self.version)
--> 154 super().__init__(log_dir=logdir, *args, **kwargs)
155
156 # register on exit fx so we always close the writer
~/.local/share/virtualenvs/smartch/lib/python3.6/site-packages/torch/utils/tensorboard/writer.py in __init__(self, log_dir, comment, purge_step, max_queue, flush_secs, filename_suffix)
219 # and recreated later as needed.
220 self.file_writer = self.all_writers = None
--> 221 self._get_file_writer()
222
223 # Create default bins for histograms, see generate_testdata.py in tensorflow/tensorboard
~/.local/share/virtualenvs/smartch/lib/python3.6/site-packages/test_tube/log.py in _get_file_writer(self)
502
503 if self.all_writers is None or self.file_writer is None:
--> 504 if 'purge_step' in self.kwargs.keys():
505 most_recent_step = self.kwargs.pop('purge_step')
506 self.file_writer = FileWriter(logdir=self.log_dir, **self.kwargs)
AttributeError: 'Experiment' object has no attribute 'kwargs'
from lightning.
that’s weird. can u try on a conda env? maybe it’s somethinng with virtualenv
from lightning.
It works with conda. There is definitively something with virtualenv.
Thank you for your support!
from lightning.
released with new core features.
Next release will be a while while we add more advanced features.
from lightning.
@rallesiardo good to hear. although actually i think the issue is that pytorch 1.2.0 just released causes issue with summarywriter in test-tube. that'll be fixed soon. in the meantime though we'll keep support for pt 1.1.0
from lightning.
Related Issues (20)
- Construct objects from yaml by classmethod
- FSDP Strategy checkpoint loading
- Current FSDPPrecision does not support custom scaler for 16-mixed precision
- Differentiate testing multiple sets/models when logging
- Issue in Manual optimisation, during self.manual_backward call HOT 1
- Existing metric keys not moved to device after LearningRateFinder
- Checkpoint every_n_steps reruns epoch on restore HOT 3
- Metrics logged by self.log and metric.compute() are different HOT 1
- Multi-node Training with DDP stuck at "Initialize distributed..." on SLURM cluster HOT 3
- Full validation after first microbatch when training after LearningRateFinder
- Add a warning when some of the modules are in eval mode before the training stage
- why pytorch-lightning doc say "Model-parallel training (FSDP and DeepSpeed)". I think there is something wrong. HOT 1
- AWS Trainium fails number of device validation when using more than 1 accelerator on the instances
- OnExceptionCheckpoint: training resumes if ckpt found, even if no ckpt_path provided
- TensorBoardLogger has the wrong epoch numbers much more than the fact HOT 1
- How to incorporate vLLM in Lightning for LLM inference?
- WandbLogger `save_dir` and `dir` parameters do not work as expected.
- Loading large models with fabric, FSDP and empty_init=True does not work
- Unable to extract confusion matrix as a metric from trainer HOT 1
- Torchmetrics Accuracy issue when dont shuffle test data. HOT 1
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 lightning.