日韩性视频-久久久蜜桃-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)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 日韩成人黄色片 | 性欧美在线视频 | 精品午夜福利视频 | 污视频网站在线看 | 激情婷婷六月 | 鸥美毛片 | 深夜福利一区二区 | 欧美操老女人 | 经典杯子蛋糕日剧在线观看免费 | 僵尸艳谈| 成人国产精品蜜柚视频 | 少妇一级视频 | 亚洲黄色免费观看 | a毛片在线| 亚洲福利社 | 人人艹人人爱 | 自拍视频在线观看 | av天天在线 | 二十四小时在线更新观看 | а√在线中文网新版地址在线 | 蜜桃传媒一区二区亚洲av | 无码久久av一区二区三区 | 日本美女性高潮 | 亚洲男人天堂网址 | 老牛影视少妇在线观看 | 丝袜亚洲综合 | 最近的中文字幕在线看视频 | 男女透逼视频 | 一级免费片 | 色在线看 | 国产一区二区中文字幕 | 丝袜在线一区 | 欧美亚洲国产成人 | 天天视频黄色 | 7777精品视频| 国产欧美视频一区二区 | 蜜桃av久久久亚洲精品 | 国产伦精品一区二区三区精品 | wwwjavhd| 蜜桃网av| 日韩少妇精品 | 人妻少妇被粗大爽9797pw | 久久精品国产免费看久久精品 | 色噜噜色综合 | 亚洲黄色一区 | 亚洲夜夜夜 | 欧美夜夜骑| 性感av在线 | 亚洲精久 | 深夜老司机福利 | 黄色片在线免费看 | 久久黄色影视 | 成人欧美一区二区三区在线播放 | 久久99国产精品久久99果冻传媒 | 岛国av免费在线 | 夜夜嗨一区 | 成年人理论片 | 8ppav| 午夜精品免费 | 日韩二区 | 村姑电影在线播放免费观看 | 大胸美女被爆操 | 国产成人aaa | 精品久久久久成人码免费动漫 | 在线免费日本 | 欧美乱妇18p | jav中文字幕 | 国产丰满大乳奶水在线视频 | 春色网站 | 中文字幕亚洲图片 | 99热99热| 亚洲天堂男人天堂 | 中文字幕av在线免费 | 午夜成人在线视频 | 国产在线观看99 | 邻居少妇张开双腿让我爽一夜 | 亚洲福利一区二区 | 99免费精品 | 日本黄色免费网站 | 国产精品综合在线 | 日批视频在线看 | 亚洲成年人专区 | 天天干夜夜添 | 日韩aaaaa | 国产成人精品一区二区三区 | 亚洲性视频在线 | 夜夜爽日日澡人人添 | china国产乱xxxxx绿帽 | 中文字幕免费高清在线观看 | 毛片无码免费无码播放 | 51精产品一区一区三区 | 丁香综合网 | 国产精品第八页 | 亚洲最大av网 | 2025国产精品视频 | 国产做爰xxxⅹ高潮视频12p | 蜜臀久久99精品久久久久久宅男 | 国产精品白嫩白嫩大学美女 | 色91精品久久久久久久久 |