日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > windows >内容正文

windows

windows编译MaskRCNN

發(fā)布時間:2023/12/31 windows 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 windows编译MaskRCNN 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.


1.代碼修改為3.0語言版本


2.setup_windows.py 文件內(nèi)容為

#!/usr/bin/env pythonimport numpy as np import os # on Windows, we need the original PATH without Anaconda's compiler in it: PATH = os.environ.get('PATH') + ';C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin' from distutils.spawn import spawn, find_executable from setuptools import setup, find_packages, Extension from setuptools.command.build_ext import build_ext import sys# CUDA specific config # nvcc is assumed to be in user's PATH nvcc_compile_args = ['-O', '--ptxas-options=-v', '-arch=sm_35', '-c', '--compiler-options=-fPIC'] nvcc_compile_args = os.environ.get('NVCCFLAGS', '').split() + nvcc_compile_args cuda_libs = ['cublas'] nvcc_bin = 'nvcc.exe' lib_dir = 'lib/x64'import distutils.msvc9compiler distutils.msvc9compiler.VERSION = 14.0# Obtain the numpy include directory. This logic works across numpy versions. try:numpy_include = np.get_include() except AttributeError:numpy_include = np.get_numpy_include()cudamat_ext = Extension('D:/Works/PyProj/Eric6/pyMaskrcnnMX/rcnn/mask/gpu_mv', ['D:/Works/PyProj/Eric6/pyMaskrcnnMX/rcnn/mask/gpu_mv.cu'],language='c++',libraries=cuda_libs,extra_compile_args=nvcc_compile_args,include_dirs=[numpy_include, 'C:\\Programming\\CUDA\\v8.0\\include'])class CUDA_build_ext(build_ext):"""Custom build_ext command that compiles CUDA files.Note that all extension source files will be processed with this compiler."""def build_extensions(self):self.compiler.src_extensions.append('.cu')self.compiler.set_executable('compiler_so', 'nvcc')self.compiler.set_executable('linker_so', 'nvcc --shared')if hasattr(self.compiler, '_c_extensions'):self.compiler._c_extensions.append('.cu') # needed for Windowsself.compiler.spawn = self.spawnbuild_ext.build_extensions(self)def spawn(self, cmd, search_path=1, verbose=0, dry_run=0):"""Perform any CUDA specific customizations before actually launchingcompile/link etc. commands."""if (sys.platform == 'darwin' and len(cmd) >= 2 and cmd[0] == 'nvcc' andcmd[1] == '--shared' and cmd.count('-arch') > 0):# Versions of distutils on OSX earlier than 2.7.9 inject# '-arch x86_64' which we need to strip while using nvcc for# linkingwhile True:try:index = cmd.index('-arch')del cmd[index:index+2]except ValueError:breakelif self.compiler.compiler_type == 'msvc':cmd[:1] = ['nvcc', '--compiler-bindir',os.path.dirname(find_executable("cl.exe", PATH))or cmd[0]]# - Secondly, we fix a bunch of command line arguments.for idx, c in enumerate(cmd):# create .dll instead of .pyd files#if '.pyd' in c: cmd[idx] = c = c.replace('.pyd', '.dll') #20160601, by MrX# replace /c by -cif c == '/c': cmd[idx] = '-c'# replace /DLL by --sharedelif c == '/DLL': cmd[idx] = '--shared'# remove --compiler-options=-fPICelif '-fPIC' in c: del cmd[idx]# replace /Tc... by ...elif c.startswith('/Tc'): cmd[idx] = c[3:]# replace /Fo... by -o ...elif c.startswith('/Fo'): cmd[idx:idx+1] = ['-o', c[3:]]# replace /LIBPATH:... by -L...elif c.startswith('/LIBPATH:'): cmd[idx] = '-L' + c[9:]# replace /OUT:... by -o ...elif c.startswith('/OUT:'): cmd[idx:idx+1] = ['-o', c[5:]]# remove /EXPORT:initlibcudamat or /EXPORT:initlibcudalearnelif c.startswith('/EXPORT:'): del cmd[idx]# replace cublas.lib by -lcublaselif c == 'cublas.lib': cmd[idx] = '-lcublas'# - Finally, we pass on all arguments starting with a '/' to the# compiler or linker, and have nvcc handle all other argumentsif '--shared' in cmd:pass_on = '--linker-options='# we only need MSVCRT for a .dll, remove CMT if it sneaks in:cmd.append('/NODEFAULTLIB:libcmt.lib')else:pass_on = '--compiler-options='cmd = ([c for c in cmd if c[0] != '/'] +[pass_on + ','.join(c for c in cmd if c[0] == '/')])# For the future: Apart from the wrongly set PATH by Anaconda, it# would suffice to run the following for compilation on Windows:# nvcc -c -O -o <file>.obj <file>.cu# And the following for linking:# nvcc --shared -o <file>.dll <file1>.obj <file2>.obj -lcublas# This could be done by a NVCCCompiler class for all platforms.spawn(cmd, search_path, verbose, dry_run)setup(name="mask_voting_gpu",description="Performs linear algebra computation on the GPU via CUDA",ext_modules=[cudamat_ext],cmdclass={'build_ext': CUDA_build_ext}, )
出現(xiàn)錯誤:

LINK : fatal error LNK1181: 無法打開輸入文件“ID=2.obj”

解決方法:




總結(jié)

以上是生活随笔為你收集整理的windows编译MaskRCNN的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 91色站 | 综合亚洲色图 | 精品国产乱码久久久久久影片 | 成人免费看片&#39; | 偷拍亚洲另类 | 伊人草草 | 久久久国产免费 | 最好看的2019年中文视频 | 国产91啪| 国产精品综合久久久 | 超级碰在线视频 | 无码av免费精品一区二区三区 | 岳狂躁岳丰满少妇大叫 | 亚洲一级片网站 | 夜夜看| 亚洲国产婷婷香蕉久久久久久99 | 日韩精品观看 | 狠狠地日 | 中文字幕一区久久 | 欧美国产精品一二三 | 欧美日韩亚洲免费 | 成年人福利视频 | 少妇av一区二区三区无码 | 田中瞳av | 白浆在线 | 欧美熟妇精品一区二区蜜桃视频 | 亚洲天堂五码 | 国产无套精品一区二区 | 一级特黄高清 | 亚洲国产精品成人va在线观看 | 性爽爽| 黄色一级片. | 91麻豆国产 | 国产精品美女一区二区三区 | 韩国毛片一区二区三区 | 一区二区三区播放 | 日本少妇性高潮 | 久久久久亚洲AV成人无在 | www.涩涩爱 | www国产精品 | 老鸭窝视频在线观看 | 91嫩草视频在线观看 | 夜夜骑天天干 | 欧美一二三区 | 国产一区二区日韩 | 日韩福利社 | 亚洲av无一区二区三区怡春院 | 精品视频一二三区 | 视频在线观看一区二区三区 | 欧产日产国产精品98 | 伊人激情影院 | 久久精品国产成人av | 射影院 | av福利院| 欧美激情福利 | 亚洲va天堂va欧美ⅴa在线 | 韩国三级与黑人 | 无套爆插 | 在线观看国产网站 | 可以直接看的毛片 | 欧美草草| 女儿的朋友5中汉字晋通话 欧美成人免费高清视频 | youjizz亚洲 | 亚洲砖区区免费 | 欧美你懂的 | 夜间福利在线观看 | 男人的天堂中文字幕 | 国产日韩欧美一二三区 | 亚洲无线视频 | wwwwxxx日本| 99久久亚洲精品 | 亚洲一级二级三级 | 国产精品福利影院 | 国语对白做受xxxxx在线中国 | 免费在线成人网 | 亚洲综合久久网 | 福利资源在线观看 | 人妻精品一区 | 欧美黄频 | 国产高清不卡一区 | 国产91热爆ts人妖系列 | 97久久久久久久久久 | 中文字幕免费观看视频 | 精品999久久久 | 免费啊v在线观看 | 黄色成年人视频 | 日韩欧美国产精品综合嫩v 国产小毛片 | 人妻无码久久一区二区三区免费 | 夜夜爽av福利精品导航 | 亚洲第一av在线 | 日本中文字幕网站 | 亚洲av永久一区二区三区蜜桃 | 成人午夜免费观看 | 看av网址| 快射视频网 | 日韩av线 | 日本一区二区三区免费观看 | 777米奇影视第四色 五月丁香久久婷婷 | 国产精品视频成人 |