aleju / face-generator

Generate human faces with neural networks
MIT License
312 stars 70 forks source link

Error while running #1

Open quintendewilde opened 7 years ago

quintendewilde commented 7 years ago

I'm getting following error.

 python generate_dataset.py --path="/Users/myusername/Facegenerator/openface/data/dcgan-completion.tensorflow/data/lfw"
[Warning] directory '/Users/myusername/Facegenerator/openface/data/dcgan-completion.tensorflow/data/lfw' contained 1 files with extension differing from 'jpg'
Found 13233 images total.
Image 0...
Traceback (most recent call last):
  File "generate_dataset.py", line 195, in <module>
    main()
  File "generate_dataset.py", line 48, in main
    brightness_change=0.1, noise_mean=0.0, noise_std=0.00)
  File "generate_dataset.py", line 130, in augment
    arr = tf.warp(img, matrix, mode="nearest") # projects to float 0-1
  File "/usr/local/lib/python2.7/site-packages/skimage/transform/_warps.py", line 775, in warp
    order=order, mode=mode, cval=cval))
  File "skimage/transform/_warps_cy.pyx", line 94, in skimage.transform._warps_cy._warp_fast (skimage/transform/_warps_cy.c:2557)
ValueError: Invalid mode specified.  Please use `constant`, `edge`, `wrap`, `reflect` or `symmetric`.
aleju commented 7 years ago

I think that error comes from an outdated skimage version, try pip install --upgrade scikit-image

quintendewilde commented 7 years ago

Upgraded it and got new errors... Very stranged because I followed the installation just 3days ago so it's also strange that it's outdated... Though I am new at this, probably oversaw something.

tests.openface_demo_tests.test_classification_demo_training ... FAIL
tests.openface_neural_net_training_tests.test_dnn_training ... FAIL

======================================================================
FAIL: tests.openface_batch_represent_tests.test_batch_represent
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/root/openface/tests/openface_batch_represent_tests.py", line 40, in test_batch_represent
    lfwSubset), "Get lfw-subset by running ./data/download-lfw-subset.sh"
AssertionError: Get lfw-subset by running ./data/download-lfw-subset.sh

======================================================================
FAIL: tests.openface_demo_tests.test_classification_demo_training
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/root/openface/tests/openface_demo_tests.py", line 70, in test_classification_demo_training
    assert os.path.isdir(lfwSubset), 'Get lfw-subset by running ./data/download-lfw-subset.sh'
AssertionError: Get lfw-subset by running ./data/download-lfw-subset.sh

======================================================================
FAIL: tests.openface_neural_net_training_tests.test_dnn_training
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/root/openface/tests/openface_neural_net_training_tests.py", line 38, in test_dnn_training
    lfwSubset), "Get lfw-subset by running ./data/download-lfw-subset.sh"
AssertionError: Get lfw-subset by running ./data/download-lfw-subset.sh

----------------------------------------------------------------------
Ran 7 tests in 17.939s
aleju commented 7 years ago

These errors don't look to me like they come from my scripts? Apparently they request you to execute /data/download-lfw-subset.sh in order to download the LFW dataset. Are you sure this is the project that you used three days ago? It looks like you are trying to do something with OpenFace.

quintendewilde commented 7 years ago

Yeah I found a stack page with it have something to do with my command line tools probably.

Hanimiao commented 6 years ago

I would like to ask you how to solve this problem?

Hanimiao commented 6 years ago

ValueError: Invalid mode specified. Please use constant, edge, wrap, reflect or symmetric. What does this mean? Do you know what caused it?

aleju commented 6 years ago

Try upgrading your scipy and scikit-image, I think that error pops up with outdated versions. I.e. do something like: sudo pip install --upgrade scipy scikit-image

cestdoe commented 6 years ago

I had the same error as described above. @aleju, please checkout the script dataset/generate_dataset.py in line 130, I changed the value of mode to 'constant' and It runs until stops at another error in line 40, currently the value is 'nearest', as the error says that value is invalid.

Source: http://scikit-image.org/docs/stable/api/skimage.transform.html#warp

aleju commented 6 years ago

Fixed the one in line 130, thanks for the info. What other error are you getting? generate_dataset.py seems to run fine for me. Probably some problem with a newer version of a library. I currently can't update here, so I can't check that.

cestdoe commented 6 years ago

error

OS: Windows 10 Home Python: 2.7.14 Terminal: Windows Powershell of Visual Studio Code version 1.19.1 command: python .\generate_dataset.py --path="../lfw" (lfw is in the root of repository) cwd: repo_root/dataset

aleju commented 6 years ago

Hm not sure what your problem here is. That stacktrace isn't very useful and stops at a point where it shouldn't throw an IOError. I just tried executing the script and get way past image 27. The best I could find online was that it seems to be an error that can sometimes pop up in windows when reading and writing to the same file, but that shouldn't be the case here.