Dlib: --yes not accepted as a command ?

Created on 25 Jul 2019  路  14Comments  路  Source: davisking/dlib

Current Behavior

I am trying to install dlib with CUDA support. However upon running this command post cmake gives following error:
Command I am running: sudo python3 setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA
Error: The --yes options to dlib's setup.py don't do anything since all these options
are on by default. So --yes has been removed. Do not give it to setup.py.

Now I thought removing --yes parameters would solve it but it gives me this prompt:
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'USE_AVX_INSTRUCTIONS'

At this point I am not sure on how to run the setup.py to finally install it using CUDA support.

Please note I have faced no issues in building dlib using cmake. All the steps that come before it, didnt fail for me.

I have all the dependencies installed too.

Expected Behavior

I expect to install dlib using CUDA on my Ubuntu 16.04.

Steps to Reproduce

I am installing dlib using CUDA using this process here:

$ git clone https://github.com/davisking/dlib.git
$ cd dlib
$ mkdir build
$ cd build
$ cmake .. -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=1
$ cmake --build .
$ cd ..
$ python setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA

  • Version: Master on current git repo
  • Where did you get dlib: github
  • Platform: Ubuntu 16.04 64 bit
  • Compiler: gcc and g++ 5.4.0
inactive

Most helpful comment

These options are on by default now. To explicitly turn them on, try this instead:
python setup.py install --set USE_AVX_INSTRUCTIONS=1 --set DLIB_USE_CUDA=1

All 14 comments

Have you tried not passing --yes, as suggested? That option was removed, take a look at the release notes: http://dlib.net/release_notes.html

Have you tried not passing --yes, as suggested? That option was removed, take a look at the release notes: http://dlib.net/release_notes.html

Hey arrufat,

Yes. Like my post says, not passing yes has different error:

Now I thought removing --yes parameters would solve it but it gives me this prompt:
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'USE_AVX_INSTRUCTIONS

Yes, USE_AVX_INSTRUCTIONS isn't a valid option either, so why not check the options on the setup.py file? It seems that you need to pass --set before that...

Can you please elaborate on this? I do not understand what needs to be done. I am also having the same error, but on:
Ubuntu 18.04
gcc-6 and g++-6

Warning: this issue has been inactive for 35 days and will be automatically closed on 2019-10-09 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

Warning: this issue has been inactive for 43 days and will be automatically closed on 2019-10-09 if there is no further activity.

If you are waiting for a response but haven't received one it's possible your question is somehow inappropriate. E.g. it is off topic, you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's official compilation instructions, dlib's API documentation, or a Google search.

Notice: this issue has been closed because it has been inactive for 45 days. You may reopen this issue if it has been closed in error.

use the below command:
python setup.py install

These options are on by default now. To explicitly turn them on, try this instead:
python setup.py install --set USE_AVX_INSTRUCTIONS=1 --set DLIB_USE_CUDA=1

Don鈥檛 do either of these. These things are set automatically.

None of these suggestions above is working for me. I have deleted dlib in site-packages and build file in dlib directory. Then, re-build files and re-run setup.py with and without --set parameters.

python setup.py install --set USE_AVX_INSTRUCTIONS=1 --set DLIB_USE_CUDA=1

python setup.py install

At last, I run print(dlib.DLIB_USE_CUDA) and still get a false

just use "python setup.py install". like it says it is set by default so no need to "set" anything.

I enabled the USE_CUDA and USE_AVX_INSTRUCTIONS flag when building dlib using cmake, then, I just used this command to install it:

python setup.py install

but it is still printing dlib.DLIB_USE_CUDA as False when i do this

import dlib
print(dlib.DLIB_USE_CUDA)

I was having the same problem. I redid the installation repeatedly, until I was sure I was doing it correctly, but dlib.DLIB_USE_CUDA remained False.

I finally figured out that there were two problems.

  • I'd installed some CMake utilities in Visual Studio Code. Apparently dlib doesn't like these. Removing them and installing Visual Studio C++, then making sure CMake was in the environment variables path made compilation go a lot more smoothly.
  • Anaconda had its own version of dlib, which I'd apparently installed at some other point. So when I thought that I was using one version, I was actually using another.
  • After fixing these, DLIB_USE_CUDA is true.

Maybe this will help someone in the future.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mohsin512 picture mohsin512  路  5Comments

lvella picture lvella  路  4Comments

pliablepixels picture pliablepixels  路  4Comments

yourmailhacked picture yourmailhacked  路  3Comments

ardamavi picture ardamavi  路  3Comments