Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

numpy1.15.4 can't find module named 'numpy.core._multiarray_umath' #261

Closed
qinbatista opened this issue Mar 3, 2019 · 13 comments
Closed

Comments

@qinbatista
Copy link

Python version: 3.6.8
Operating system: macOS Mojave 10.14.3

command: python faceswap.py extract

error:
03/04/2019 00:54:06 INFO Log level set to: INFO
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ImportError: numpy.core.multiarray failed to import
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "", line 968, in _find_and_load
SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-03-04 00:54:06.762221: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr
Abort trap: 6

I changed numpy to 1.16
error:
03/04/2019 00:52:57 INFO Log level set to: INFO
03/04/2019 00:52:59 INFO Output Directory: output
03/04/2019 00:52:59 INFO Input Directory: input
03/04/2019 00:52:59 INFO Loading Detect from Mtcnn plugin...
03/04/2019 00:52:59 INFO Loading config: '/Users/yupengqin/Desktop/faceswap/config/extract.ini'
03/04/2019 00:52:59 INFO Loading Align from Fan plugin...
03/04/2019 00:52:59 WARNING No GPU detected. Switching to CPU mode
03/04/2019 00:52:59 INFO Starting, this may take a while...
03/04/2019 00:52:59 ERROR No frames to process. Exiting

It seems numpy1.15.4 can't find module but 1.6 or other version of numpy can't be regonized by project.

@torzdf
Copy link
Collaborator

torzdf commented Mar 3, 2019

Numpy 1.16 is broken don't use it.

You would need to provide a crash_log for people to be able to help you.

@tjdwo13579
Copy link

@qinbatista Same situation here. Have you been able to solve the issue yet??
Would be much appreciated if you shared your solution.

@qinbatista
Copy link
Author

@qinbatista Same situation here. Have you been able to solve the issue yet??
Would be much appreciated if you shared your solution.

I found numpy1.15.4 really don't have numpy/core/_multiarray_umath but other version have, Maybe tensorflow version is wrong but I already use default setting.... Can't understand why appear such problem, I give up to use Mac, prepare to use Linux and try again

@qinbatista
Copy link
Author

Numpy 1.16 is broken don't use it.

You would need to provide a crash_log for people to be able to help you.

Hi torzdf,

But faceswap can't find numpy/core/_multiarray_umath when I am using numpy1.15.4, program was not crashed just can't compile because of python library error...Maybe version is not matched, but I already installed all library from requirements.txt

@tjdwo13579
Copy link

tjdwo13579 commented Mar 5, 2019

@qinbatista I've finally succeeded running training on my system.

My Current Environment
OS: Windows 10
CPU: i5-8600K
GPU: GTX 1070
CUDA: 10.0
cuDNN: 7.4.2
CMake: 3.11.0-rc1
Visual Studio 2015 v14.0
Python 3.6.4 64bit

numpy v1.16.0
tensorflow-gpu v1.13.1

I don't know what exactly solved my problem so I'll explain everything I've done.

  1. Update my graphic driver to the latest
  2. remove numpy by "pip uninstall numpy" -> I ran this several times since I've noticed there were other older versions of numpy still exist after uninstalling once
  3. install numpy v1.16.0 -> which solved the numpy issue
  4. ran into problem with "estimator module"
  5. run "pip uninstall tensorflow-estimator" several times -> run "pip install tensorflow-estimator"

after this I was successfully able to run training.

However I noticed that VRAM was a huge issue for me.
Previously when I trained with the OriginalHighRes (= Unbalanced) model, I was able to train up to a batch size of 30. But now I'm barely able to train with 12.
I'm aware that the model has been changed but.. is it changed so that it requires over almost double the size compared to the past??

Anyway I hope this helps you!

@qinbatista
Copy link
Author

@qinbatista I've finally succeeded running training on my system.

My Current Environment
OS: Windows 10
CPU: i5-8600K
GPU: GTX 1070
CUDA: 10.0
cuDNN: 7.4.2
CMake: 3.11.0-rc1
Visual Studio 2015 v14.0
Python 3.6.4 64bit

numpy v1.16.0
tensorflow-gpu v1.13.1

I don't know what exactly solved my problem so I'll explain everything I've done.

  1. Update my graphic driver to the latest
  2. remove numpy by "pip uninstall numpy" -> I ran this several times since I've noticed there were other older versions of numpy still exist after uninstalling once
  3. install numpy v1.16.0 -> which solved the numpy issue
  4. ran into problem with "estimator module"
  5. run "uninstall tensorflow-estimator" several times -> run "install tensorflow-estimator"

after this I was successfully able to run training.

However I noticed that VRAM was a huge issue for me.
Previously when I trained with the OriginalHighRes (= Unbalanced), I was able to train up to a batch size of 30. But now I'm barely able to train with 12.
I'm aware that the model has been changed but.. is it changed so that it requires over almost double the size compared to the past??

Anyway I hope this helps you!

congratulation brother! finally you changed numpy version, I think faceswap program have very strictly version requirement.

As author said, Windows only will use 20% of GPU, but at least you can run right, I am going to reinstall my computer to linux and try again.

@tjdwo13579
Copy link

tjdwo13579 commented Mar 5, 2019

@qinbatista Thanks!

I thought it was something like "exclude 20% of GPU", but its the total opposite. Wow that's quite disappointing.

Btw are u going to run linux virtually?

@qinbatista
Copy link
Author

@qinbatista Thanks!

I thought it was something like "exclude 20% of GPU", but its the total opposite. Wow that's quite disappointing.

Btw are u going to run linux virtually?

hahaha, no, I am going to run totally on linux machine, I have similar machine like yours, I7-7700k, GTX1060. I will install one more linux system on my PC in order to use 100% of GPU, so it will save me a lot of time, as I know some people sell APP named deepfakeAPP or similer like that in China, just download and doule click to use, but it is really slow, linux is the best choice, but few people will do like that, so I want to try linux anyway, hahaha good bless me

@tjdwo13579
Copy link

tjdwo13579 commented Mar 5, 2019

@qinbatista
Okay! Good luck :)

@torzdf
Copy link
Collaborator

torzdf commented Mar 5, 2019

Don't use numpy 1.16.0. There is a bug which means all your system RAM will get swallowed up and your system will crash.

Windows will RESERVE approx 20% of your GPU, you will still have approx 80% for faceswapping.

This:
faceswap can't find numpy/core/_multiarray_umath
is not a faceswap error. It is a numpy error. Most likely you have both pip and conda numpy installed.

I recommend using the installer to install in Windows. You can find it in releases.

@tjdwo13579
Copy link

tjdwo13579 commented Mar 7, 2019

@torzdf Contrary to your argument (I have also checked deepfakes/faceswap#594 (comment)), I was able to successfully run extract,train,convert with no errors.
I ran extraction with about 300 images. Perhaps I haven't hit the error threshold?

@torzdf
Copy link
Collaborator

torzdf commented Mar 7, 2019

You will, at some point, hit a memory leak on extract with numpy 1.16.0:
numpy/numpy#12793

@tjdwo13579
Copy link

@torzdf As you said I hit the memory leak with 1.16.0, it did not crash but slowed the process immensely.
I updated numpy to 1.16.2 (latest) and it seems to solved the issue entirely.
Out of 16GB memory, it stays well below half usage.

Thanks for helping out!

@torzdf torzdf closed this as completed Jun 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants