Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: main thread is not in main loop #5

Closed
ManivannanMurugavel opened this issue Nov 23, 2017 · 9 comments
Closed

RuntimeError: main thread is not in main loop #5

ManivannanMurugavel opened this issue Nov 23, 2017 · 9 comments

Comments

@ManivannanMurugavel
Copy link

When i ran the train.py
(python3 train.py --data-root=./datapath/ljspeech/ --hparams="batch_size=10")

This error is came:
Exception ignored in: <bound method Image.del of <tkinter.PhotoImage object at 0x7f1b5f86a710>>
Traceback (most recent call last):
File "/usr/lib/python3.5/tkinter/init.py", line 3359, in del
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop

@r9y9
Copy link
Owner

r9y9 commented Nov 23, 2017

What line of train.py causes the error?

@ManivannanMurugavel
Copy link
Author

it did not show what the line.
only show the error is
Exception ignored in: <bound method Image.del of <tkinter.PhotoImage object at 0x7f1b5f86a710>>
Traceback (most recent call last):
File "/usr/lib/python3.5/tkinter/init.py", line 3359, in del
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop

@r9y9
Copy link
Owner

r9y9 commented Nov 23, 2017

Well, after some googling, It seems there's a problem in your GUI backend for matplotlib. Does the following code work for you?

import matplotlib
import matplotlib.pyplot as plt 
plt.plot([1,2,3])

and

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt 
plt.plot([1,2,3])

@ManivannanMurugavel
Copy link
Author

i tried this way but the same error is came.
i also googling.
please help me.
(plese send your mail id to manivannanmca2012@gmail.com)

@r9y9
Copy link
Owner

r9y9 commented Nov 23, 2017

So the issue is not related to deepvoice3_pytorch. Please ask a question or file an issue to matplotlib community. I cannot reproduce.

@r9y9 r9y9 closed this as completed Nov 25, 2017
@ManivannanMurugavel
Copy link
Author

I have solved this error.
Thank you

@toannhu
Copy link

toannhu commented Mar 14, 2018

@ManivannanMurugavel I have the same problem as you. Could you show me the way to fix it? Really appreciate!

@ManivannanMurugavel
Copy link
Author

@toannhu Please remove matplotlib for loss and accuracy graph.
Just see the what training acc and loss in terminal.
Solution:
Please command the all save_alignment() def inside train.py.

r9y9 pushed a commit that referenced this issue Apr 30, 2018
…pport (#78)

* Fixed typeerror (torch.index_select received an invalid combination of arguments)

  File "synthesis.py", line 137, in <module>
    model, text, p=replace_pronunciation_prob, speaker_id=speaker_id, fast=True)
  File "synthesis.py", line 66, in tts
    sequence, text_positions=text_positions, speaker_ids=speaker_ids)
  File "H:\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "H:\Tensorflow_Study\git\deepvoice3_pytorch\deepvoice3_pytorch\__init__.py", line 79, in forward
    text_positions, frame_positions, input_lengths)
  File "H:\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "H:\Tensorflow_Study\git\deepvoice3_pytorch\deepvoice3_pytorch\__init__.py", line 116, in forward
    text_sequences, lengths=input_lengths, speaker_embed=speaker_embed)
  File "H:\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "H:\Tensorflow_Study\git\deepvoice3_pytorch\deepvoice3_pytorch\deepvoice3.py", line 75, in forward
    x = self.embed_tokens(text_sequences) <- change this to long!
  File "H:\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "H:\envs\pytorch\lib\site-packages\torch\nn\modules\sparse.py", line 103, in forward
    self.scale_grad_by_freq, self.sparse
  File "H:\envs\pytorch\lib\site-packages\torch\nn\_functions\thnn\sparse.py", line 59, in forward
    output = torch.index_select(weight, 0, indices.view(-1))
TypeError: torch.index_select received an invalid combination of arguments - got (�[32;1mtorch.cuda.FloatTensor�[0m, �[32;1mint�[0m, �[31;1mtorch.cuda.IntTensor�[0m), but expected (torch.cuda.FloatTensor source, int dim, torch.cuda.LongTensor index)

changed text_sequence to long, as required by torch.index_select.

* Fixed Nonetype error in collect_features

* requirements.txt fix

* Memory Leakage bugfix + hparams change

* Pre-PR modifications

* Pre-PR modifications 2

* Pre-PR modifications 3

* Post-PR modification

* remove requirements.txt

* num_workers to 1 in train.py

* Windows log filename bugfix

* Revert "Windows log filename bugfix"

This reverts commit 5214c24.

* merge 2

* Windows Filename bugfix

In windows, this causes WinError 123

* Cleanup before PR

* JSON format Metadata support

Supports JSON format for dataset creation. Ensures compatibility with http://github.com/carpedm20/multi-Speaker-tacotron-tensorflow

* Web based Gentle aligner support

* README change + gentle patch

* .gitignore change

gitignore change

* Flake8 Fix

* Post PR commit - Also fixed #5

#53 (comment) issue solved in PyTorch 0.4

* Post-PR 2 - .gitignore
@thakur101
Copy link

@ManivannanMurugavel I have encountered the same error
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python3.6/tkinter/init.py", line 772, in after_cancel
data = self.tk.call('after', 'info', id)
RuntimeError: main thread is not in main loop
can you please help me with this ?

joclement pushed a commit to joclement/master_thesis that referenced this issue Mar 8, 2021
The following exception has already occured a couple of times:
Exception ignored in: <function Image.__del__ at 0x7fe33a287dc0>
Traceback (most recent call last):
  File "/home/corp.cyren.com/jclement/.pyenv/versions/3.8.7/lib/python3.8/tkinter/__init__.py",
  line 4020, in __del__
RuntimeError: main thread is not in main loop

Searching for a cause of this error led me to this result:
r9y9/deepvoice3_pytorch#5
It suggest that matplotlib might be causing this. Therefore the plotting
of the scores is removed from this script. It can still easily be done
with the visualize-results scripts.
joclement added a commit to joclement/master_thesis that referenced this issue Mar 21, 2021
The following exception has already occured a couple of times:
Exception ignored in: <function Image.__del__ at 0x7fe33a287dc0>
Traceback (most recent call last):
  File "/home/corp.cyren.com/jclement/.pyenv/versions/3.8.7/lib/python3.8/tkinter/__init__.py",
  line 4020, in __del__
RuntimeError: main thread is not in main loop

Searching for a cause of this error led me to this result:
r9y9/deepvoice3_pytorch#5
It suggest that matplotlib might be causing this. Therefore the plotting
of the scores is removed from this script. It can still easily be done
with the visualize-results scripts.
joclement added a commit to joclement/master_thesis that referenced this issue Mar 21, 2021
The following exception has already occured a couple of times, Paths
modified for readability:
Exception ignored in: <function Image.__del__ at 0x7fe33a287dc0>
Traceback (most recent call last):
  File "~/.pyenv/versions/3.8.7/lib/python3.8/tkinter/__init__.py",
  line 4020, in __del__
RuntimeError: main thread is not in main loop

Searching for a cause of this error led me to this result:
r9y9/deepvoice3_pytorch#5
It suggest that matplotlib might be causing this. Therefore the plotting
of the scores is removed from this script. It can still easily be done
with the visualize-results scripts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants