openpose icon indicating copy to clipboard operation
openpose copied to clipboard

Windows 10 Openpose VS2019 not building [LNK1181]

Open giopri13 opened this issue 3 years ago • 10 comments

Issue Summary

Hello openpose community. I've been trying multiple times to setup and run openpose from source code. I'm on Windows 10 Pro, using Visual Studio 2019 Community, unfortunately every attempt so far has been unsuccessful. The guides I followed include the official documentation and this [https://github.com/quickgrid/Setup-Guide/blob/master/README.md#windows-10-cmu-openpose-setup-visual-studio-2019-cmake-nvidia-gpu]. I have also tried following some recent youtube videos (not released before 2019).

Executed Command (if any)

Note: add --logging_level 0 --disable_multi_thread to get higher debug information.

OpenPose Output (if any)

Errors (if any)

LINK : fatal error LNK1181: non è possibile aprire il file di input '....\src\openpose\Release\openpose.lib'

Type of Issue

Select the topic(s) on your post, delete the rest:

  • Compilation/installation error
  • Execution error

Your System Configuration

  1. Whole console output (if errors appeared), paste the error to PasteBin and then paste the link here: https://pastebin.com/KGAseBSR

  2. OpenPose version: Latest GitHub code? Or specific commit (e.g., d52878f)? Or specific version from Release section (e.g., 1.2.0)? Version 1.7.0

  3. General configuration:

    • Installation mode: CMake, sh script, manual Makefile installation, ... (Ubuntu); CMake, ... (Windows); ...? Cmake on Windows 10
    • Operating system (lsb_release -a in Ubuntu): Windows 10 Pro
    • Operating system version (e.g., Ubuntu 16, Windows 10, ...): Build 19042.867
    • Release or Debug mode? (by default: release): Release
    • Compiler (gcc --version in Ubuntu or VS version in Windows): 5.4.0, ... (Ubuntu); VS2015 Enterprise Update 3, VS2017 community, ... (Windows); ...? Visual Studio Community 2019
  4. Non-default settings:

    • 3-D Reconstruction module added? (by default: no):
    • Any other custom CMake configuration with respect to the default version? (by default: no):
  5. 3rd-party software:

    • Caffe version: Default from OpenPose, custom version, ...? Default
    • CMake version (cmake --version in Ubuntu): 3.19.6
    • OpenCV version: pre-compiled apt-get install libopencv-dev (only Ubuntu); OpenPose default (only Windows); compiled from source? If so, 2.4.9, 2.4.12, 3.1, 3.2?; ...? OpenPose Default
  6. If GPU mode issue:

    • CUDA version (cat /usr/local/cuda/version.txt in most cases): 11.1
    • cuDNN version: 8.0.5
    • GPU model (nvidia-smi in Ubuntu): GTX 1060
  7. If CPU-only mode issue:

    • CPU brand & model: Ryzen 5 3600
    • Total RAM memory available: 16GB
  8. If Python API:

    • Python version: 2.7, 3.7, ...?
    • Numpy version (python -c "import numpy; print numpy.version.version" in Ubuntu):
  9. If Windows system:

    • Portable demo or compiled library? Compiled Library
  10. If speed performance issue:

giopri13 avatar Apr 02 '21 10:04 giopri13

You have to build the library first. otherwise it cant find the lib. But from my testing, CUDA not workout anyways, build error during compile CU files. May just try OPENCL version

424778940z avatar Apr 20 '21 21:04 424778940z

Hello, did you find a solution yet? I am facing the same issue. I am trying to install openpose with cuda 11.1, cudnn 8.1.0 and Visual Studio 2019 Version 16.9.4 running on a rtx3070. When building in VS, I get the same Error LNK1181 as described above. I tried reinstalling everything but still no progress. Also I want to install the Python API with Python 3.8. What do you mean by "build the libary first"? How do I do that? I have not a lot of experience with building from source. Thank you.

Christoph9402 avatar Apr 22 '21 18:04 Christoph9402

Sorry @Christoph9402 but no solution for me. In the end I had to switch to Ubuntu and use an older OpenPose version to work with zed-openpose. I've gone on a different path. I've left this issue open because I'm still curious about Windows compatibility

@424778940z Could you please explain how did you build the library?

giopri13 avatar Apr 22 '21 19:04 giopri13

my setup: VS2019, latest msvc and winsdk. cuda 10.2+cudnn 7.6.5 and cuda 11.1+cudnn8.x latest both works Cmake, git, in path.

I think your issue is with the libopenpose build failed then apps cant link to it. you may have to patch two files resizeAndMergeBase.cu and cuda.hu from floor to floorf _patch.zip

my build script

rmdir /s /q openpose
git clone --branch=master https://github.com/CMU-Perceptual-Computing-Lab/openpose.git .\openpose
cd openpose
git checkout -qf b1cb2b69cf8c4c288921e48c37f339a64db26f58
copy /y ..\_patch\resizeAndMergeBase.cu .\src\openpose\net\resizeAndMergeBase.cu
copy /y ..\_patch\cuda.hu .\include\openpose_private\gpu\cuda.hu
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019" -A x64 -T v142 -DGPU_MODE=CUDA
cmake --build . --config Release
cd ..
cd ..
copy .\openpose\build\bin\*.* .\openpose\build\x64\Release\
xcopy /e /i /y .\openpose\doc .\openpose\build\x64\Release\doc
xcopy /e /i /y .\openpose\models .\openpose\build\x64\Release\models

if you want opengl cv window support you have to build opencv by your own since supported version not come with it

424778940z avatar Apr 22 '21 19:04 424778940z

@424778940z Thank you so much! It runs perfectly now.

Christoph9402 avatar Apr 22 '21 22:04 Christoph9402

@424778940z Thank you so much! It runs perfectly now.

apologize for asking for an off topic question, do you mind share your hard ware setup, video res., and fps with me? I still have performance issue with my setup which is 1080ti, 1080p, 6fps...

424778940z avatar Apr 22 '21 22:04 424778940z

I am getting around 11-12 frames a second in the OpenPose Demo, but for me that is way better to work with than the performance on my cpu-only laptop. I have a RTX3070 with 8Gb, 16gb ram, ryzen 5 3600. The webcam records in fullhd. The cuda version is 11.1, cudnn version is 8.1.0 and for the python api, I am using Python 3.8. The Nvidia driver is 466.11

Christoph9402 avatar Apr 22 '21 22:04 Christoph9402

Thanks for the info, I'm planning get a 3090, but it is really hard to buy at a reasonable price now days.

424778940z avatar Apr 22 '21 22:04 424778940z

my setup: VS2019, latest msvc and winsdk. cuda 10.2+cudnn 7.6.5 and cuda 11.1+cudnn8.x latest both works Cmake, git, in path.

I think your issue is with the libopenpose build failed then apps cant link to it. you may have to patch two files resizeAndMergeBase.cu and cuda.hu from floor to floorf _patch.zip

my build script

rmdir /s /q openpose
git clone --branch=master https://github.com/CMU-Perceptual-Computing-Lab/openpose.git .\openpose
cd openpose
git checkout -qf b1cb2b69cf8c4c288921e48c37f339a64db26f58
copy /y ..\_patch\resizeAndMergeBase.cu .\src\openpose\net\resizeAndMergeBase.cu
copy /y ..\_patch\cuda.hu .\include\openpose_private\gpu\cuda.hu
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019" -A x64 -T v142 -DGPU_MODE=CUDA
cmake --build . --config Release
cd ..
cd ..
copy .\openpose\build\bin\*.* .\openpose\build\x64\Release\
xcopy /e /i /y .\openpose\doc .\openpose\build\x64\Release\doc
xcopy /e /i /y .\openpose\models .\openpose\build\x64\Release\models

if you want opengl cv window support you have to build opencv by your own since supported version not come with it

@424778940z You're a life saver bro ... Thank you very much for the patch files!

jacob0811 avatar May 16 '21 15:05 jacob0811

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 07:01 stale[bot]