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)
- Support `ThunderModule` models HOT 2
- Calculated loss differs from logged loss in training_step (even if seed_everything, deterministic set to true and shuffle to false) HOT 1
- Trainer does not wait for neptune logger completion and logger connection stays open unless explicitly closed HOT 1
- Validation does not produce any output in PyTorch Lightning using my UNetTestModel
- Unable to extend FSDPStrategy to HPU accelerator HOT 7
- SaveConfigCallback.save_config is conflict with DDP HOT 1
- Logging Documentation Does not Detail How to Access the Logged Values during the fit loop
- Apply the ignore of the save_hyperparameters function to args as well.
- Cannot run in SLURM Interactive Session
- Resume from mid steps inside an epoch
- `DDPStrategy` fails when using accelerators other than CUDA
- PyTorch Lightning with T5 Model - RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn HOT 1
- Script freezes when Trainer is instantiated
- Sanitize object params before they get logged from argument-free classes
- Support GAN based model training with deepspeed which need to setup fabric twice HOT 2
- IndexError: Pytorch-lightning CompositionalMetric require tensor.item() if dim=0 whether I did so
- Huge metrics jump between epochs && Step and epoch log not matched, when accumulate_grad_batches > 1
- Does `fabric.save()` save on rank 0? HOT 3
- Turn off hpc checkpoint saving in SLURM environment if trainer.fit(..., ckpt_path="last") HOT 3
- DDP strategy doesn't work for on_validation_epoch_end, always hang HOT 4
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.