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

[Help!!]error of spawning new processes while running image_retrieval.py #17

Open
spaul13 opened this issue Dec 29, 2019 · 2 comments
Open

Comments

@spaul13
Copy link

spaul13 commented Dec 29, 2019

I am getting the following error of spawning the process while running "python image_retrieval.py"

Brief error message:
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if name == 'main':
freeze_support()

error.txt

Can anyone plz help me saying why I am getting this error and how to get rid of this error?

@filipe-monteiro
Copy link

filipe-monteiro commented Apr 27, 2020

Same error here. maybe the file image_retrieval.py be wrapped in a main() function and then end with:

if name == "main":
main()

edit:

yep, did just that and it works, as in:

import os
import numpy as np
import tensorflow as tf
from sklearn.neighbors import NearestNeighbors
from src.CV_IO_utils import read_imgs_dir
from src.CV_transform_utils import apply_transformer
from src.CV_transform_utils import resize_img, normalize_img
from src.CV_plot_utils import plot_query_retrieval, plot_tsne, plot_reconstructions
from src.autoencoder import AutoEncoder

if name == 'main':
# Run mode: (autoencoder -> simpleAE, convAE) or (transfer learning -> vgg19)
modelName = "vgg19" # try: "simpleAE", "convAE", "vgg19"
trainModel = True
parallel = True # use multicore processing
...
..._

@larrywal-express
Copy link

Another problem generated after I added below to the code.
if name== "main":
The problem is with the
"Class ImageTransformer (object)"

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

3 participants