darknet icon indicating copy to clipboard operation
darknet copied to clipboard

deprecate msbuild solutions

Open cenit opened this issue 3 years ago • 16 comments

what's your opinion, @AlexeyAB ?

cenit avatar Apr 25 '21 20:04 cenit

@cenit Hi,

  • I think we should keep compiling with CMake-GUI for Windows, some users want to control anything

  • I think sometime we should remove build/darknet, and re-write manual/examples in Readme.MD with identical paths for Linux and Windows versions. So we can use just Cmake-GUI and build.ps/vcpkg (and Makefile for Linux). But currently I am using this way build/darknet, because I can control and change anything, and it is very stable, I never had any issues. So before removing build/darknet we should find the most stable way to compile Darknet, such way which had the least issues and depends on other software as little as possible.

  • It would also be great if we could change this way and make it as simple as possible (I don't know if it is possible):
PS Code/>              git clone https://github.com/AlexeyAB/darknet
PS Code/>              cd darknet
PS Code/darknet>       ./build.ps1 -UseVCPKG -EnableOPENCV -EnableCUDA -EnableCUDNN

to something like this:

  1. Download https://github.com/AlexeyAB/darknet/archive/refs/heads/master.zip
  2. Press right mouse-button on darknet-master.zip file and press Extract-all -> Extract
  3. Enter inside /darknet-master/ folder and press left double-click on build.ps1 file
  4. It will ask which libraries it will install, we recommend clicking Yes for all questions

And

  • it will find all required libraries CUDA/cuDNN/OpenCV/vcpkg/...
  • try to install missed libraries (which it can install)
  • compile Darknet with all found libraries
  • keep terminal opened if some error occurs, so user can read and send it to us

Also we can try to add darknet_yolo_v4.cmd to build directory, and add to manual:

  • Download yolov4-trained weights https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights
  • run darknet_yolo_v4.cmd and see prediction in the window While darknet_yolo_v4.cmd contains: ./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/dog.jpg so user can install and check that Darknet & YOLO work correctly without a line in the terminal

AlexeyAB avatar Apr 25 '21 22:04 AlexeyAB

@cenit Hi,

  • I think we should keep compiling with CMake-GUI for Windows, some users want to control anything

of course I am not removing it! I am even using cmake from command line and manually editing its own cache in order to fine-control everything! Where did you get that I was removing CMake-GUI for windows as an option?

  • I think sometime we should remove build/darknet, and re-write manual/examples in Readme.MD with identical paths for Linux and Windows versions. So we can use just Cmake-GUI and build.ps/vcpkg (and Makefile for Linux). But currently I am using this way build/darknet, because I can control and change anything, and it is very stable, I never had any issues. So before removing build/darknet we should find the most stable way to compile Darknet, such way which had the least issues and depends on other software as little as possible.

Do you still use the visual studio solutions? Because at the moment at least for me they do not work very well and they are out-of-date! CMake is creating solutions for users that want them, instead of us having to maintain them! The whole idea of this PR was to remove "old" visual studio solutions, and collect scripts together, independently from linux or windows. Let's keep them together and slowly we can make all of them compatible on any OS.

  • It would also be great if we could change this way and make it as simple as possible (I don't know if it is possible):
PS Code/>              git clone https://github.com/AlexeyAB/darknet
PS Code/>              cd darknet
PS Code/darknet>       ./build.ps1 -UseVCPKG -EnableOPENCV -EnableCUDA -EnableCUDNN

to something like this:

  1. Download https://github.com/AlexeyAB/darknet/archive/refs/heads/master.zip
  2. Press right mouse-button on darknet-master.zip file and press Extract-all -> Extract
  3. Enter inside /darknet-master/ folder and press left double-click on build.ps1 file
  4. It will ask which libraries it will install, we recommend clicking Yes for all questions

And

  • it will find all required libraries CUDA/cuDNN/OpenCV/vcpkg/...
  • try to install missed libraries (which it can install)
  • compile Darknet with all found libraries
  • keep terminal opened if some error occurs, so user can read and send it to us

did you try your procedure with a recent darknet? It should work this way :)

Also we can try to add darknet_yolo_v4.cmd to build directory, and add to manual:

  • Download yolov4-trained weights https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights
  • run darknet_yolo_v4.cmd and see prediction in the window While darknet_yolo_v4.cmd contains: ./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/dog.jpg so user can install and check that Darknet & YOLO work correctly without a line in the terminal

Users installing darknet from vcpkg used to have also weights pre-downloaded for them. Unfortunately now they have to manually download them, but I prepared this script https://github.com/AlexeyAB/darknet/blob/master/scripts/download_weights.ps1 which downloads weights automatically (and which we can call automatically from build.ps1 if you want)

cenit avatar May 01 '21 23:05 cenit

@cenit Hi,

did you try your procedure with a recent darknet? It should work this way :)

No, it doesn't work. I tried both ways:

  1. just double-click on build.ps1, it asks about vcpkg/cuda/cudnn/opencv, for all questions I enter Y, and then the window closes, so I can't see the error message
  2. I tried to run Start -> Windows PowerShell -> PowerShell, then enter cd path-to-darknet, then run ./build.ps1, but it shows the error: + CategoryInfo :Security error: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess Something like : Unable to load file build.ps1, because scripting is disabled on this system. For more information see ...

AlexeyAB avatar May 11 '21 20:05 AlexeyAB

of course I am not removing it! I am even using cmake from command line and manually editing its own cache in order to fine-control everything! Where did you get that I was removing CMake-GUI for windows as an option?

It looks like I looked in the wrong place :)

Do you still use the visual studio solutions? Because at the moment at least for me they do not work very well and they are out-of-date!

Yes, I use it, and it works well for me.

CMake is creating solutions for users that want them, instead of us having to maintain them! The whole idea of this PR was to remove "old" visual studio solutions, and collect scripts together, independently from linux or windows. Let's keep them together and slowly we can make all of them compatible on any OS.

In the end, this is a good idea, but first we need to make everything else as stable and simple as possible.

Users installing darknet from vcpkg used to have also weights pre-downloaded for them. Unfortunately now they have to manually download them, but I prepared this script https://github.com/AlexeyAB/darknet/blob/master/scripts/download_weights.ps1 which downloads weights automatically (and which we can call automatically from build.ps1 if you want)

Yes, I think it can be a good idea for the easiest compilation way (or VCPKG can ask about it).

merge with pjreddie master

Also I see that you tried to merge it with pjreddie-repository that is inconsist with this repo. What is the main idea?

AlexeyAB avatar May 11 '21 20:05 AlexeyAB

please try to unblock your powershell

Set-ExecutionPolicy unrestricted

cenit avatar May 11 '21 20:05 cenit

@cenit

It still doesn't work: result.txt While I successfully compiled and ran it by using Cmake-GUI (Windows 10, MSVS2019, CUDA 11.2, cuDNN 8.x, without OpenCV)

I used:

  1. Download https://github.com/AlexeyAB/darknet/archive/refs/heads/master.zip
  2. Press right mouse-button on darknet-master.zip file and press Extract-all -> Extract
  3. Go to Start -> Windows PowerShell -> (Right Click) on Windows PowerShell -> Run as Administrator -> type Set-ExecutionPolicy unrestricted and press Enter -> Press y
  4. type cd path-to-darknet, type ./build.ps1, press R if you see question about Execution policy
  5. It will ask which libraries it will install, we recommend clicking Yes for all questions

AlexeyAB avatar May 11 '21 21:05 AlexeyAB

how to build darknet, I tried all previous powershell methods and all gave me errors? please which is the best way to build darknet

besbesmany avatar May 12 '21 00:05 besbesmany

how to build darknet, I tried all previous powershell methods and all gave me errors? please which is the best way to build darknet

I'm seeing this a lot on the darknet/yolo Discord lately. Unfortunately I don't have Windows, so I cannot help users. But many times per week, people are saying they tried to follow the instructions in the readme and they can no longer build on Windows. At the very least, I think we need to have better instructions. See the "building-in-windows" channel on https://discord.gg/zSq8rtW for details on what type of errors they're running into.

stephanecharette avatar May 12 '21 02:05 stephanecharette

@cenit

It still doesn't work: result.txt

should be fixed by 44a48c3c1411109568f65ec5166dae509e38ba74

cenit avatar May 14 '21 10:05 cenit

Also I see that you tried to merge it with pjreddie-repository that is inconsist with this repo. What is the main idea?

just because this repo otherwise looks behind pjreddie's one (see header in main page)

cenit avatar May 14 '21 10:05 cenit

the merge is without any change to our files, it's just an empty import of the commits from the other repo

cenit avatar May 14 '21 10:05 cenit

@cenit Hi, I think:

  • We should reate tag or release for the current commit for users who still use old installation way
  • Maybe we should get some feedback from users about new installation ways
  • We should create some 2-3 .cmd-files in the root directory with examples of detection on image/video like: darknet.exe detector test ./cfg/coco.data ./cfg/yolov4.cfg ./yolov4.weights data/dog.jpg -i 0 -thresh 0.25 darknet.exe detector demo ./cfg/coco.data ./cfg/yolov4.cfg ./yolov4.weights test.mp4 -ext_output -avgframes 1 darknet.exe detector demo ./cfg/coco.data ./cfg/yolov4.cfg ./yolov4.weights rtsp://admin:[email protected]:554

Also should we rename Using also PowerShell to How to compile on Linux/macOS (using PowerShell) ? https://github.com/AlexeyAB/darknet#using-also-powershell

AlexeyAB avatar Jun 11 '21 00:06 AlexeyAB

@cenit Hi, I think:

  • We should reate tag or release for the current commit for users who still use old installation way
  • Maybe we should get some feedback from users about new installation ways
  • We should create some 2-3 .cmd-files in the root directory with examples of detection on image/video like: darknet.exe detector test ./cfg/coco.data ./cfg/yolov4.cfg ./yolov4.weights data/dog.jpg -i 0 -thresh 0.25 darknet.exe detector demo ./cfg/coco.data ./cfg/yolov4.cfg ./yolov4.weights test.mp4 -ext_output -avgframes 1 darknet.exe detector demo ./cfg/coco.data ./cfg/yolov4.cfg ./yolov4.weights rtsp://admin:[email protected]:554

Also should we rename Using also PowerShell to How to compile on Linux/macOS (using PowerShell) ? https://github.com/AlexeyAB/darknet#using-also-powershell

ok thanks for suggestions. I will add a download_weight optional step during build too, which will be used by these cmd files in order to have weights ready for these examples, so that not only users but also CI can run them, to make sure that the executables not only build, but work too

cenit avatar Jun 11 '21 08:06 cenit

@cenit Hi,

Should we also add Docker or add link to this one? https://github.com/daisukekobayashi/darknet-docker

AlexeyAB avatar Jun 29 '21 19:06 AlexeyAB

we should create our own

i will add it in the next PR, together with some basic run tests on darknet itself

cenit avatar Jun 29 '21 19:06 cenit

/rebase

cenit avatar Nov 16 '21 16:11 cenit