nnsum icon indicating copy to clipboard operation
nnsum copied to clipboard

ERROR:ignite.engine.engine.Engine:Engine run is terminating due to exception: Loss must have at least one example before it can be computed

Open sada-machine opened this issue 6 years ago • 1 comments

Hi,

Getting the following error. I am trying with the pubmed data for "train the CNN encoder with Seq2Seq extractor on gpu 0"

Traceback (most recent call last): File "script_bin/train_model.py", line 79, in main() File "script_bin/train_model.py", line 76, in main results_path=args["trainer"]["results"]) File "/home/paperspace/Documents/python3env/lib/python3.6/site-packages/nnsum-1.0-py3.6.egg/nnsum/trainer/labels_mle_trainer.py", line 164, in labels_mle_trainer File "/home/paperspace/Documents/python3env/lib/python3.6/site-packages/pytorch_ignite-0.1.2-py3.6.egg/ignite/engine/engine.py", line 326, in run self._handle_exception(e) File "/home/paperspace/Documents/python3env/lib/python3.6/site-packages/pytorch_ignite-0.1.2-py3.6.egg/ignite/engine/engine.py", line 291, in _handle_exception raise e File "/home/paperspace/Documents/python3env/lib/python3.6/site-packages/pytorch_ignite-0.1.2-py3.6.egg/ignite/engine/engine.py", line 317, in run self._fire_event(Events.EPOCH_COMPLETED) File "/home/paperspace/Documents/python3env/lib/python3.6/site-packages/pytorch_ignite-0.1.2-py3.6.egg/ignite/engine/engine.py", line 226, in _fire_event func(self, *(event_args + args), **kwargs) File "/home/paperspace/Documents/python3env/lib/python3.6/site-packages/pytorch_ignite-0.1.2-py3.6.egg/ignite/metrics/metric.py", line 68, in completed engine.state.metrics[name] = self.compute() File "/home/paperspace/Documents/python3env/lib/python3.6/site-packages/nnsum-1.0-py3.6.egg/nnsum/metrics/loss.py", line 21, in compute ignite.exceptions.NotComputableError: Loss must have at least one example before it can be computed

sada-machine avatar Feb 08 '19 13:02 sada-machine

Hi,

I also get the following error. I am trying with the CNN data for "train the CNN encoder with Seq2SeqSentenceExtractor without GPU" I used python3.7.4, torch 1.3 and ignite 1.3. And the environment is Ubuntu 16.04

Traceback (most recent call last): File "script_bin/train_model.py", line 79, in main() File "script_bin/train_model.py", line 76, in main results_path=args["trainer"]["results"]) File "/home/soe/anaconda3/lib/python3.7/site-packages/nnsum-1.0-py3.7.egg/nnsum/trainer/labels_mle_trainer.py", line 164, in labels_mle_trainer File "/home/soe/anaconda3/lib/python3.7/site-packages/pytorch_ignite-0.3.0.dev20191029-py3.7.egg/ignite/engine/engine.py", line 470, in run self._handle_exception(e) File "/home/soe/anaconda3/lib/python3.7/site-packages/pytorch_ignite-0.3.0.dev20191029-py3.7.egg/ignite/engine/engine.py", line 420, in _handle_exception raise e File "/home/soe/anaconda3/lib/python3.7/site-packages/pytorch_ignite-0.3.0.dev20191029-py3.7.egg/ignite/engine/engine.py", line 461, in run self._fire_event(Events.EPOCH_COMPLETED) File "/home/soe/anaconda3/lib/python3.7/site-packages/pytorch_ignite-0.3.0.dev20191029-py3.7.egg/ignite/engine/engine.py", line 355, in _fire_event func(self, *(event_args + args), **kwargs) File "/home/soe/anaconda3/lib/python3.7/site-packages/pytorch_ignite-0.3.0.dev20191029-py3.7.egg/ignite/metrics/metric.py", line 122, in completed result = self.compute() File "/home/soe/anaconda3/lib/python3.7/site-packages/nnsum-1.0-py3.7.egg/nnsum/metrics/loss.py", line 21, in compute ignite.exceptions.NotComputableError: Loss must have at least one example before it can be computed

Soe2Lwin avatar Oct 30 '19 05:10 Soe2Lwin