Code Monkey home page Code Monkey logo

Comments (4)

andreae293 avatar andreae293 commented on September 28, 2024 1

Thank you, i did it and i resolved that issue. Now it loads the params without any exception.

Here's how i managed to do it

cd src/ncnn
git checkout master
git submodule update --init --recursive

I had to modify src/NcnnDotNet.Native/CMakeLists.txt by removing the following lines

            glslang
            GenericCodeGen
            MachineIndependent
            OGLCompiler
            OSDependent
            SPIRV

otherwise the following error would rise

[  2%] Linking CXX shared library NcnnDotNetNative.dll
LINK: command "C:\PROGRA~2\MICROS~1\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\NcnnDotNetNative.dir\objects1 /out:NcnnDotNetNative.dll /implib:NcnnDotNetNative.lib /pdb:C:\Users\andre\Desktop\ML\NcnnDotNet\src\NcnnDotNet.Native\build_win_desktop_vulkan_x64\NcnnDotNetNative.pdb /dll /version:0.0 /machine:x64 /INCREMENTAL:NO ncnn\install\lib\ncnn.lib opencv\install\x64\vc15\staticlib\opencv_highgui341.lib opencv\install\x64\vc15\staticlib\opencv_imgcodecs341.lib opencv\install\x64\vc15\staticlib\opencv_imgproc341.lib C:\VulkanSDK\1.3.236.0\Lib\vulkan-1.lib glslang.lib GenericCodeGen.lib MachineIndependent.lib OGLCompiler.lib OSDependent.lib SPIRV.lib C:\VulkanSDK\1.3.236.0\Lib\vulkan-1.lib ncnn\install\lib\glslang.lib ncnn\install\lib\SPIRV.lib ncnn\install\lib\MachineIndependent.lib ncnn\install\lib\OGLCompiler.lib ncnn\install\lib\OSDependent.lib ncnn\install\lib\GenericCodeGen.lib opencv\install\x64\vc15\staticlib\opencv_videoio341.lib opencv\install\x64\vc15\staticlib\opencv_imgcodecs341.lib opencv\install\x64\vc15\staticlib\libjpeg.lib opencv\install\x64\vc15\staticlib\libwebp.lib opencv\install\x64\vc15\staticlib\libpng.lib opencv\install\x64\vc15\staticlib\libtiff.lib opencv\install\x64\vc15\staticlib\libjasper.lib opencv\install\x64\vc15\staticlib\IlmImf.lib opencv\install\x64\vc15\staticlib\opencv_imgproc341.lib opencv\install\x64\vc15\staticlib\opencv_core341.lib opencv\install\x64\vc15\staticlib\zlib.lib vfw32.lib comctl32.lib gdi32.lib ole32.lib setupapi.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:NcnnDotNetNative.dll.manifest" failed (exit code 1181) with the following output:
LINK : fatal error LNK1181: impossibile aprire il file di input 'MachineIndependent.lib'

finally i had to remove those lines from nuget/BuildUtils.ps1

   Write-Host "git submodule update --init --recursive" -ForegroundColor Yellow
   git submodule update --init --recursive

otherwise it would pull the old ncnn

then i could launch
pwsh BuildWindows.ps1

thanks again for your time

from ncnndotnet.

takuya-takeuchi avatar takuya-takeuchi commented on September 28, 2024

@andreae293
I think you can use

public bool UseWinogradConvolution

and

public bool UseSgemmConvolution

from ncnndotnet.

andreae293 avatar andreae293 commented on September 28, 2024

oh well that was easy, thanks
but i do have another question now, not sure if i should open another issue or not
the following code

var net = new NcnnDotNet.Net();
net.LoadParam("./assets/FrozenCLIPEmbedder-fp16.param");

throw an exception:
System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
i already checked that file is not corrupted or read/write protected
the file in question is this, which loads correctly in the original project
do you have any idea on what is causing the issue? thanks again

from ncnndotnet.

takuya-takeuchi avatar takuya-takeuchi commented on September 28, 2024

Oh... I didn't know ncnn suport Stable Diffusion!!
But current code base is old (2021/05/07) so it may cause issue you faced.
So we would have to use latest ncnn.

You can try to load this param file by using latest ncnn c++.
If you do not face issue, you can do the followign steps.

  1. Checkout lastest ncnn https://github.com/takuya-takeuchi/NcnnDotNet/tree/master/src
  2. Build ncnndotnet yourself by using https://github.com/takuya-takeuchi/NcnnDotNet/blob/master/nuget/BuildUbuntu16.ps1

But I'm not sure you can update code base w/o any issue.

from ncnndotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.