PyQt5 after starting new thread, the main thread exitHow to check if current thread is not main threadQt processes signals after threads exit?JVM not exiting until daemon thread not completedMain thread not catching KeyboardInterruptIs there any order for Java main thread and user created thread execution?How to print some messages before and after thread iteration?C batch processing data and main thread wait for all sub-threadsExecutor Service and Main Thread not executing in parallelWhy is it that fewer threads finished than started in ExecutorService?Python threading neither exiting nor 'threading'
Why does this expression simplify as such?
PTIJ: Why is Haman obsessed with Bose?
How to draw a matrix with arrows in limited space
Why is so much work done on numerical verification of the Riemann Hypothesis?
Why should universal income be universal?
The Digit Triangles
Does Doodling or Improvising on the Piano Have Any Benefits?
The IT department bottlenecks progress, how should I handle this?
Has the laser at Magurele, Romania reached a tenth of the Sun's power?
Does "he squandered his car on drink" sound natural?
Why is the "ls" command showing permissions of files in a FAT32 partition?
Does the Linux kernel need a file system to run?
Has any country ever had 2 former presidents in jail simultaneously?
Is there any evidence that Cleopatra and Caesarion considered fleeing to India to escape the Romans?
Why do Radio Buttons not fill the entire outer circle?
Can I say "fingers" when referring to toes?
Is there a nicer/politer/more positive alternative for "negates"?
US tourist/student visa
Mimic lecturing on blackboard, facing audience
Microchip documentation does not label CAN buss pins on micro controller pinout diagram
A variation to the phrase "hanging over my shoulders"
Creating two special characters
Review your own paper in Mathematics
What (the heck) is a Super Worm Equinox Moon?
PyQt5 after starting new thread, the main thread exit
How to check if current thread is not main threadQt processes signals after threads exit?JVM not exiting until daemon thread not completedMain thread not catching KeyboardInterruptIs there any order for Java main thread and user created thread execution?How to print some messages before and after thread iteration?C batch processing data and main thread wait for all sub-threadsExecutor Service and Main Thread not executing in parallelWhy is it that fewer threads finished than started in ExecutorService?Python threading neither exiting nor 'threading'
def pre_train(self, path):
self.newdata = load_metadata(path)
last_idx = self.embedded.shape[0]
embedded = np.zeros((self.metadata.shape[0] + self.newdata.shape[0], 128))
embedded[:self.embedded.shape[0]] = self.embedded
self.embedded = embedded
print(self.newdata.shape)
class FaceThread(QRunnable):
def run(self):
print("Start pre train")
self.worker.pretrain(self.path)
print("Training ")
self.worker.train()
print("Finish Train")
# main
self.thread = FaceThread()
self.thread.setPath(self.img_url)
self.thread.setWorker(self.worker)
QThreadPool.globalInstance().start(self.thread)
I use print function, find the thread really start execute, but after several seconds, the program will exit without any message. Who can help me explain about this? Is it too complicated about the sub thread? :)
python multithreading pyqt
New contributor
add a comment |
def pre_train(self, path):
self.newdata = load_metadata(path)
last_idx = self.embedded.shape[0]
embedded = np.zeros((self.metadata.shape[0] + self.newdata.shape[0], 128))
embedded[:self.embedded.shape[0]] = self.embedded
self.embedded = embedded
print(self.newdata.shape)
class FaceThread(QRunnable):
def run(self):
print("Start pre train")
self.worker.pretrain(self.path)
print("Training ")
self.worker.train()
print("Finish Train")
# main
self.thread = FaceThread()
self.thread.setPath(self.img_url)
self.thread.setWorker(self.worker)
QThreadPool.globalInstance().start(self.thread)
I use print function, find the thread really start execute, but after several seconds, the program will exit without any message. Who can help me explain about this? Is it too complicated about the sub thread? :)
python multithreading pyqt
New contributor
please provide a Minimal, Complete, and Verifiable example
– S. Nick
14 hours ago
sorry about the unclear edition, It will just output "start pre train". But when it go into worker.pretrain(), the program will exit(). (So, could it provide enough message about the issue?)
– LuoNet
13 hours ago
@LuoNet Have you created an eventloop with QCoreApplication, QGuiApplication or QApplication ?, the cause of the error could be many so if you want help you should provide an Minimal, Complete, and Verifiable example
– eyllanesc
9 hours ago
add a comment |
def pre_train(self, path):
self.newdata = load_metadata(path)
last_idx = self.embedded.shape[0]
embedded = np.zeros((self.metadata.shape[0] + self.newdata.shape[0], 128))
embedded[:self.embedded.shape[0]] = self.embedded
self.embedded = embedded
print(self.newdata.shape)
class FaceThread(QRunnable):
def run(self):
print("Start pre train")
self.worker.pretrain(self.path)
print("Training ")
self.worker.train()
print("Finish Train")
# main
self.thread = FaceThread()
self.thread.setPath(self.img_url)
self.thread.setWorker(self.worker)
QThreadPool.globalInstance().start(self.thread)
I use print function, find the thread really start execute, but after several seconds, the program will exit without any message. Who can help me explain about this? Is it too complicated about the sub thread? :)
python multithreading pyqt
New contributor
def pre_train(self, path):
self.newdata = load_metadata(path)
last_idx = self.embedded.shape[0]
embedded = np.zeros((self.metadata.shape[0] + self.newdata.shape[0], 128))
embedded[:self.embedded.shape[0]] = self.embedded
self.embedded = embedded
print(self.newdata.shape)
class FaceThread(QRunnable):
def run(self):
print("Start pre train")
self.worker.pretrain(self.path)
print("Training ")
self.worker.train()
print("Finish Train")
# main
self.thread = FaceThread()
self.thread.setPath(self.img_url)
self.thread.setWorker(self.worker)
QThreadPool.globalInstance().start(self.thread)
I use print function, find the thread really start execute, but after several seconds, the program will exit without any message. Who can help me explain about this? Is it too complicated about the sub thread? :)
python multithreading pyqt
python multithreading pyqt
New contributor
New contributor
edited 9 hours ago
eyllanesc
83.8k103562
83.8k103562
New contributor
asked 14 hours ago
LuoNetLuoNet
42
42
New contributor
New contributor
please provide a Minimal, Complete, and Verifiable example
– S. Nick
14 hours ago
sorry about the unclear edition, It will just output "start pre train". But when it go into worker.pretrain(), the program will exit(). (So, could it provide enough message about the issue?)
– LuoNet
13 hours ago
@LuoNet Have you created an eventloop with QCoreApplication, QGuiApplication or QApplication ?, the cause of the error could be many so if you want help you should provide an Minimal, Complete, and Verifiable example
– eyllanesc
9 hours ago
add a comment |
please provide a Minimal, Complete, and Verifiable example
– S. Nick
14 hours ago
sorry about the unclear edition, It will just output "start pre train". But when it go into worker.pretrain(), the program will exit(). (So, could it provide enough message about the issue?)
– LuoNet
13 hours ago
@LuoNet Have you created an eventloop with QCoreApplication, QGuiApplication or QApplication ?, the cause of the error could be many so if you want help you should provide an Minimal, Complete, and Verifiable example
– eyllanesc
9 hours ago
please provide a Minimal, Complete, and Verifiable example
– S. Nick
14 hours ago
please provide a Minimal, Complete, and Verifiable example
– S. Nick
14 hours ago
sorry about the unclear edition, It will just output "start pre train". But when it go into worker.pretrain(), the program will exit(). (So, could it provide enough message about the issue?)
– LuoNet
13 hours ago
sorry about the unclear edition, It will just output "start pre train". But when it go into worker.pretrain(), the program will exit(). (So, could it provide enough message about the issue?)
– LuoNet
13 hours ago
@LuoNet Have you created an eventloop with QCoreApplication, QGuiApplication or QApplication ?, the cause of the error could be many so if you want help you should provide an Minimal, Complete, and Verifiable example
– eyllanesc
9 hours ago
@LuoNet Have you created an eventloop with QCoreApplication, QGuiApplication or QApplication ?, the cause of the error could be many so if you want help you should provide an Minimal, Complete, and Verifiable example
– eyllanesc
9 hours ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
LuoNet is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55280124%2fpyqt5-after-starting-new-thread-the-main-thread-exit%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
LuoNet is a new contributor. Be nice, and check out our Code of Conduct.
LuoNet is a new contributor. Be nice, and check out our Code of Conduct.
LuoNet is a new contributor. Be nice, and check out our Code of Conduct.
LuoNet is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55280124%2fpyqt5-after-starting-new-thread-the-main-thread-exit%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
please provide a Minimal, Complete, and Verifiable example
– S. Nick
14 hours ago
sorry about the unclear edition, It will just output "start pre train". But when it go into worker.pretrain(), the program will exit(). (So, could it provide enough message about the issue?)
– LuoNet
13 hours ago
@LuoNet Have you created an eventloop with QCoreApplication, QGuiApplication or QApplication ?, the cause of the error could be many so if you want help you should provide an Minimal, Complete, and Verifiable example
– eyllanesc
9 hours ago