亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

pycocotools介紹以及在windows10下的安裝過程

 更新時間:2023年02月22日 09:22:53   作者:.?小王同學.  
這篇文章主要介紹了pycocotools介紹以及在windows10下的安裝過程,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教

前言

最近在學習SSD目標檢測算法,需要用到pycocotools,所以這里就簡單介紹一下pycocotools是什么以及安裝教程。

pycocotools庫的介紹

pycocotools是什么?即python api tools of COCO。

COCO是一個大型的圖像數(shù)據(jù)集,用于目標檢測、分割、人的關(guān)鍵點檢測、素材分割和標題生成。這個包提供了Matlab、Python和luaapi,這些api有助于在COCO中加載、解析和可視化注釋。

請訪問http://cocodataset.org/,可以了解關(guān)于COCO的更多信息,包括數(shù)據(jù)、論文和教程。

COCO網(wǎng)站上也描述了注釋的確切格式。Matlab和PythonAPI是完整的,LuaAPI只提供基本功能。

除了這個API,請下載COCO圖片和注釋,以便運行演示和使用API。

兩者都可以在項目網(wǎng)站上找到。

  • -請下載、解壓縮并將圖像放入:coco/images/
  • -請下載并將注釋放在:coco/annotations中/

pycocotools庫的安裝

環(huán)境:windows10x64 ,python 3.7。不需要額外安裝vs。

發(fā)現(xiàn)網(wǎng)上好多教程都需要額外安裝 vc++2015 build tools,感覺很麻煩,這里只需要一行命令即可:

pip install pycocotools-windows

驗證安裝是否成功,輸入:import pycocotools._mask as _mask

若沒有報錯,則安裝成功。

參考:pycocotools的使用

pycocotools安裝失敗 compiler_compat/ld

項目場景

安裝pycocotools出現(xiàn)的問題,python版本是3.6.9,在conda環(huán)境下:

gcc -pthread -shared -B /home/hm/anaconda3/envs/lan/compiler_compat -L/home/hm/anaconda3/envs/lan/lib -Wl,-rpath=/home/hm/anaconda3/envs/lan/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/../common/maskApi.o build/temp.linux-x86_64-3.6/pycocotools/_mask.o -o build/lib.linux-x86_64-3.6/pycocotools/_mask.cpython-36m-x86_64-linux-gnu.so
/home/hm/anaconda3/envs/xxx/compiler_compat/ld: build/temp.linux-x86_64-3.6/../common/maskApi.o: unable to initialize decompress status for section .debug_info
/home/hm/anaconda3/envs/xxx/compiler_compat/ld: build/temp.linux-x86_64-3.6/../common/maskApi.o: unable to initialize decompress status for section .debug_info
/home/hm/anaconda3/envs/xxx/compiler_compat/ld: build/temp.linux-x86_64-3.6/../common/maskApi.o: unable to initialize decompress status for section .debug_info
/home/hm/anaconda3/envs/xxx/compiler_compat/ld: build/temp.linux-x86_64-3.6/../common/maskApi.o: unable to initialize decompress status for section .debug_info
build/temp.linux-x86_64-3.6/../common/maskApi.o: file not recognized: file format not recognized
collect2: 錯誤: ld 返回 1
error: command 'gcc' failed with exit status 1</font>

問題描述

安裝pycocotools失敗

原因分析

應(yīng)該是系統(tǒng)動態(tài)鏈接庫和conda環(huán)境里的庫哪里出了問題,從錯誤信息里看出gcc使用的是conda環(huán)境里的ld,

解決方案

嘗試使用系統(tǒng)的ld,因為如果找不到conda里的ld,會自動使用系統(tǒng)的ld

cd到anaconda下環(huán)境的目錄里,把ld這個文件暫時改成其他名字

不過只是臨時解決而已,可能是我操作不當引起的問題

總結(jié)

以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。

您可能感興趣的文章:

相關(guān)文章

最新評論