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

time-consuming of the FID computation #67

Closed
LonglongaaaGo opened this issue Apr 20, 2021 · 14 comments
Closed

time-consuming of the FID computation #67

LonglongaaaGo opened this issue Apr 20, 2021 · 14 comments

Comments

@LonglongaaaGo
Copy link

time-consuming of the FID computation
Hi, I want to know why the FID computation is very slow. When I calculate the FID of 28000 images, it sometimes got stuck and spent almost one day or more to calculate once! Is there any idea to help me fix this problem? Thanks!

@LonglongaaaGo
Copy link
Author

BTW, I want to know if fake data numbers and real data numbers are not equal, will it affect the calculation of FID?

@mseitzer
Copy link
Owner

mseitzer commented Apr 21, 2021

It is hard to debug this from afar because it can depend on many different factors. In general, I don't see an intrinsic reason why it should get stuck at some points (computation should be equally fast over time). You can install tqdm to get a better overview how the computation progresses. You could also try to profile the code using cProfile.

I don't understand your second question, can you clarify?

@LonglongaaaGo
Copy link
Author

Sorry for reply late.
I found when I am running the codes. It will get stuck in the "calculate_frechet_distance" can you give me some insights to solve this problem?
Thanks again for your consideration!

@LonglongaaaGo
Copy link
Author

I am running these codes in the SLURM cluster.

@Totoro97
Copy link

@LonglongaaaGo Hi, I faced the similar problem and I found that the program got stuck in scipy.linalg.sqrtm. Reinstalling Scipy with newest version works for me.

@cientgu
Copy link

cientgu commented Oct 24, 2021

@LonglongaaaGo Hi, I faced the similar problem and I found that the program got stuck in scipy.linalg.sqrtm. Reinstalling Scipy with newest version works for me.

I update it to 1.7.1, it's still very slow ...

@Cerf-Volant425
Copy link

I also met the same problem ...

@Cerf-Volant425
Copy link

oh then I solved it by changing a virtual environment ...

@chensjtu
Copy link

I wonder the right version of scipy

@Cerf-Volant425
Copy link

I wonder the right version of scipy

spicy 1.5.4 worked for me.

@yuxu915
Copy link

yuxu915 commented Aug 5, 2022

I wonder the right version of scipy

spicy 1.5.4 worked for me.

also worked for me. Thanks!

@aykborstelmann
Copy link

If anyone else already still has the problem after installing the newest scipy version:
In scipy/scipy#14594 (comment) the issue was found by setting the environment variable MKL_NUM_THREADS=1 using export MKL_NUM_THREADS=1

@j-cyoung
Copy link

I met the same issue. I have a server with 4 gpus, and I ran 4 programs on each gpu on parallel. Each program will compute FID. I found that all cpus will be occupied when running multi process with FID computing in the same time, but one process ran well. I think there might be some threads conflicts between torch, scipy.linalg.sqrtm (in FID) and multi-process/threads.

Setting "export MKL_NUM_THREADS=1" didn't help. But I found that setting "export OPENBLAS_NUM_THREADS=1" or "export OMP_NUM_THREADS=1" does help for me. So anyone who has the same issue can give a try.

Related Issue: numpy/numpy#8120 (comment)
Related Blog: https://pythonspeed.com/articles/concurrency-control/

@LonglongaaaGo
Copy link
Author

Hi @Totoro97 @cientgu and others who asked questions similar to mine.
Sorry for the late reply; I just forgot I still have the issue here.
Yes, I finally solved by doing the following:

export MKL_NUM_THREADS=1

Thanks!

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

9 participants