Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues compiling and running #24

Open
gferrell opened this issue Apr 10, 2021 · 18 comments
Open

Issues compiling and running #24

gferrell opened this issue Apr 10, 2021 · 18 comments
Assignees
Labels
good first issue Good for newcomers question Further information is requested

Comments

@gferrell
Copy link

gferrell commented Apr 10, 2021

I've tried following the instructions to build and run the example.

The build powershell fails.
.\Build.ps1 Release cuda 64 desktop 2019 101
Unable to find type [Config].
_At C:\Users\geoff\source\repos\OpenPoseDotNet\src\OpenPoseDotNet.Native\Build.ps1:60 char:11

  • $Config = [Config]::new($OpenPoseDotNetRoot, $Configuration, $Target, ...
  •       ~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (Config:TypeName) [], RuntimeException
    • FullyQualifiedErrorId : TypeNotFound

Build : The term 'Build' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\geoff\source\repos\OpenPoseDotNet\src\OpenPoseDotNet.Native\Build.ps1:61 char:1

  • Build -Config $Config
  •   + CategoryInfo          : ObjectNotFound: (Build:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException_
    
    

But, the 2019 IDE builds the solution without issue Then, I try running the example instruction and get some warnings:
(01_BodyFromImageDefault)
dotnet run -c Release -i "C:\Users\geoff\source\repos\openpose-master\examples\media\COCO_val2014_000000000192.jpg"

C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\geoff\source\repos\OpenPoseDotNet\examples\TutorialApiCpp\01_BodyFromImageDefault\01_BodyFromImageDefault.csproj]
C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\geoff\source\repos\OpenPoseDotNet\examples\TutorialApiCpp\01_BodyFromImageDefault\01_BodyFromImageDefault.csproj]
C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.EolTargetFrameworks.targets(28,5): warning NETSDK1138: The target framework 'netcoreapp2.0' is out of support and will not receive security updates in the future. Please refer to https://aka.ms/dotnet-core-support for more information about the support policy. [C:\Users\geoff\source\repos\OpenPoseDotNet\examples\TutorialApiCpp\01_BodyFromImageDefault\01_BodyFromImageDefault.csproj]

Then, nothing happens after the warnings. The program exits with error code 0 and no warnings if I debug it from the IDE. No picture is shown.

@takuya-takeuchi takuya-takeuchi self-assigned this Apr 11, 2021
@takuya-takeuchi takuya-takeuchi added the question Further information is requested label Apr 11, 2021
@takuya-takeuchi
Copy link
Owner

@gferrell
Do you use Powershell core rather than Powershell?

Please check https://github.com/takuya-takeuchi/OpenPoseDotNet#1-build

But, the 2019 IDE builds the solution without issue Then, I try running the example instruction and get some warnings:
(01_BodyFromImageDefault)

OPDN depends on native binary (C++).
I guess you does not deploy OpenPoseDotNet.Native, openpose.dll and other dlls.

You can know exact library name from https://github.com/takuya-takeuchi/OpenPoseDotNet/blob/develop/examples/OpenPoseDemo/SymlinkBinary.ps1

@gferrell
Copy link
Author

gferrell commented Apr 12, 2021

Thanks for your response. i wasn't aware there was a core powershell, but I downloaded the latest version 7.

image

(is this the correct version?)
...and ran the build again. I got the following error:

image

I did run the SymlinkBinary.bat file before running the example. Should I be running the SymlinkBinary.ps1 instead?

@takuya-takeuchi
Copy link
Owner

@gferrell
Could you try Release build rather than Debug?
I remember that current code could fail to build openpose as debug.

@takuya-takeuchi
Copy link
Owner

And which branch do you try?
I tried develop branch and it is available.

@gferrell
Copy link
Author

gferrell commented Apr 14, 2021

I believe that I got the same error when I tried the Release setting previously. This time, I switched to the develop branch. I got different errors, but the build completed anyway.:
image

I tried to run the example, but only warnings and nothing displayed.

image

@takuya-takeuchi
Copy link
Owner

@gferrell
Ok, I was success to reproduce issue after clear all build cache.
For 2019, OpenPoseDotNet\src\OpenPoseDotNet.Native\build_win_desktop_cuda_x64\openpose\x64\Release is empty.
It means that build of openpose failed.

build of openpose says

D:/Works/OpenSource/OpenPoseDotNet/src/openpose/src/openpose/net/resizeAndMergeBase.cu(142): error : calling a __host__
 function("__floorf") from a __global__ function("op::resize8TimesKernel<float> ") is not allowed [D:\Works\OpenSource\
OpenPoseDotNet\src\OpenPoseDotNet.Native\build_win_desktop_cuda_x64\openpose\src\openpose\openpose.vcxproj]

This issue is repoerted in CMU-Perceptual-Computing-Lab/openpose#1886

@takuya-takeuchi takuya-takeuchi added the good first issue Good for newcomers label Apr 15, 2021
@gferrell
Copy link
Author

gferrell commented Apr 26, 2021

Hello,
I didn't get the same errors as you did. Do you know what it means?:

image

I tried the debug option. I get the same errors, but it seems to build a lot more of the projects.

@takuya-takeuchi
Copy link
Owner

@gferrell

I didn't get the same errors as you did. Do you know what it means?:

This error message is from CMake command for openpose rather than OpenPoseDotNet.Native.

   cmake -G Visual Studio 16 2019 -A x64 -D CMAKE_BUILD_TYPE=Release ^
         -D USE_CUDA:BOOL=ON ^
         -D USE_3D_RENDERER:BOOL=ON ^
         D:\Works\OpenSource\OpenPoseDotNet\src\openpose
   cmake --build . --config Release

@gferrell
Copy link
Author

gferrell commented May 3, 2021

Okay, any suggestions? I am stuck if the base code wont compile on a fresh download.

@takuya-takeuchi
Copy link
Owner

@gferrell

  1. Could you delete src\OpenPoseDotNet.Native\build_win_desktop_cuda_x64 before build by using VS2017? Old build cache may prevent from build process.
  2. It fails, please try to build openpose and show error message. I can not give any advice w/o useful information.

It could suit with your env.

$ cd C:\Users\geoff\source\repos\OpenPoseDotNet
$ git submodule update --init --recursive
$ rmdir src\OpenPoseDotNet.Native\build_win_desktop_cuda_x64
$ mkdir src\OpenPoseDotNet.Native\build_win_desktop_cuda_x64
$ cd src\OpenPoseDotNet.Native\build_win_desktop_cuda_x64
$ cmake -G "Visual Studio 15 2017" -A x64 -D CMAKE_BUILD_TYPE=Release ^
         -D USE_CUDA:BOOL=ON ^
         -D USE_3D_RENDERER:BOOL=ON ^
         C:\Users\geoff\source\repos\OpenPoseDotNet\src\openpose
$ cmake --build . --config Release

The avobe command build only openpose and show all message.

@gferrell
Copy link
Author

gferrell commented May 5, 2021

I captured the output of the last command (cmake --build . --config Release) : output.txt
I notice two errors:

 Creating library C:/Users/geoff/source/repos/OpenPoseDotNet/src/OpenPoseDotNet.Native/build_win_desktop_cuda_x64/examples/tutorial_api_cpp/Release/11_asynchronous_custom_output.lib and object C:/Users/geoff/source/repos/OpenPoseDotNet/src/OpenPoseDotNet.Native/build_win_desktop_cuda_x64/examples/tutorial_api_cpp/Release/11_asynchronous_custom_output.exp

11_asynchronous_custom_output.vcxproj -> C:\Users\geoff\source\repos\OpenPoseDotNet\src\OpenPoseDotNet.Native\build_win_desktop_cuda_x64\x64\Release\11_asynchronous_custom_output.exe
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(321,5): error MSB3491: Could not write lines to file "12_asynchronous_custom_input_output_and_datum.dir\Release\12_async.C460D1F4.tlog\12_asynchronous_custom_input_output_and_datum.lastbuildstate". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\Users\geoff\source\repos\OpenPoseDotNet\src\OpenPoseDotNet.Native\build_win_desktop_cuda_x64\examples\tutorial_api_cpp\12_asynchronous_custom_input_output_and_datum.vcxproj]

and

Creating library C:/Users/geoff/source/repos/OpenPoseDotNet/src/OpenPoseDotNet.Native/build_win_desktop_cuda_x64/examples/tutorial_api_thread/Release/1_thread_user_processing_function.lib and object C:/Users/geoff/source/repos/OpenPoseDotNet/src/OpenPoseDotNet.Native/build_win_desktop_cuda_x64/examples/tutorial_api_thread/Release/1_thread_user_processing_function.exp
1_thread_user_processing_function.vcxproj -> C:\Users\geoff\source\repos\OpenPoseDotNet\src\OpenPoseDotNet.Native\build_win_desktop_cuda_x64\x64\Release\1_thread_user_processing_function.exe
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(321,5): error MSB3491: Could not write lines to file "2_thread_user_input_processing_output_and_datum.dir\Release\2_thread.862E5A47.tlog\2_thread_user_input_processing_output_and_datum.lastbuildstate". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\Users\geoff\source\repos\OpenPoseDotNet\src\OpenPoseDotNet.Native\build_win_desktop_cuda_x64\examples\tutorial_api_thread\2_thread_user_input_processing_output_and_datum.vcxproj]

@takuya-takeuchi
Copy link
Owner

@gferrell

C:\Users\geoff\source\repos\OpenPoseDotNet\src\openpose is too long. You clone source code to short path. e.g. C:\Users\geoff\OpenPoseDotNet\src\openpose.

It is restriction of windows operating system.

My code is under D:\Works\OpenSource\OpenPoseDotNet

@gferrell
Copy link
Author

gferrell commented May 5, 2021

I created a folder with a shorter path and didn't see the errors. The overall build instructions from the main page don't work for me. I got errors like this:
image

So, I ran these instructions from another thread and this build without error:

$ git clone https://github.com/takuya-takeuchi/OpenPoseDotNet
$ cd OpenPoseDotNet
$ cd src\OpenPoseDotNet.Native
// It get to be failed of build
$ pwsh Build.ps1 Debug cuda 64 desktop 2017 100
$ git submodule update --init --recursive
$ pwsh Build.ps1 Debug cuda 64 desktop 2017 100

I tried to run the sample and I still get no output.

@takuya-takeuchi
Copy link
Owner

@gferrell
You mean that pwsh Build.ps1 Debug cuda 64 desktop should be invoked before git submodule update --init --recursive, right?

But I was success to build by these both instructions.

$ git clone https://github.com/takuya-takeuchi/OpenPoseDotNet OpenPoseDotNet1
$ cd OpenPoseDotNet1\src\OpenPoseDotNet.Native
$ pwsh Build.ps1 Debug cuda 64 desktop 2017 100
$ git submodule update --init --recursive
$ pwsh Build.ps1 Debug cuda 64 desktop 2017 100

and

$ git clone https://github.com/takuya-takeuchi/OpenPoseDotNet OpenPoseDotNet2
$ cd OpenPoseDotNet2
$ git submodule update --init --recursive
$ cd src\OpenPoseDotNet.Native
$ pwsh Build.ps1 Debug cuda 64 desktop 2017 100

@gferrell
Copy link
Author

Hello,

I was able to build with "OpenPoseDotNet2" instructions but "OpenPoseDotNet1" instructions generates errors:
image
In any case, I am happy to have something that builds.

When i run the following instructions, I just get warnings:

cd examples\TutorialApiCpp\01_BodyFromImageDefault
> .\SymlinkBinary.bat <Debug/Release> build_win_desktop_<cpu/cuda>_x64
> dotnet run -c Release  -i "examples\media\COCO_val2014_000000000192.jpg"

image

Nothing displays when I run the sample. Can you help with why the sample does not work after seemingly successful build?

@gferrell
Copy link
Author

gferrell commented Jun 9, 2021

I did some debugging in the IDE. When I run the tutorial, I get an exception:
System.DllNotFoundException
HResult=0x80131524
Message=Unable to load DLL 'OpenPoseDotNetNative': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Source=OpenPoseDotNet
StackTrace:
at OpenPoseDotNet.NativeMethods.op_flags_set_disable_multi_thread(Boolean value)
at OpenPoseDotNet.Flags.set_DisableMultiThread(Boolean value) in C:\Users\geoff\source\repos\OpenPoseDotNet2\src\OpenPoseDotNet\Flags.cs:line 383
at BodyFromImageDefault.Program.<>c__DisplayClass1_0.

b__0() in C:\Users\geoff\source\repos\OpenPoseDotNet2\examples\TutorialApiCpp\01_BodyFromImageDefault\Program.cs:line 40
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at BodyFromImageDefault.Program.Main(String[] args) in C:\Users\geoff\source\repos\OpenPoseDotNet2\examples\TutorialApiCpp\01_BodyFromImageDefault\Program.cs:line 58

I can see a zero byte sym link in the folder examples\TutorialApiCpp\01_BodyFromImageDefault\bin\Debug\netcoreapp2.0 to OpenPoseDotNetNative.dll.

@takuya-takeuchi
Copy link
Owner

@gferrell
OPDN depends on openpose.dll and many libraries.
Did you copy them, into application directory?
And you could find out which libraries are missing by using https://github.com/lucasg/Dependencies.

@gferrell
Copy link
Author

gferrell commented Jun 10, 2021

I ran the dependency finder, but it doesn't recognize the symlinks as valid files. The file lengths are zero. Where should these links be pointing to?
image
image

@gferrell gferrell reopened this Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants