Comments (19)
okay. I find the problem and solve it from the Pull requests.
modify the four cpp files(bottom_pool.cpp, left_pool.cpp, top_pool.cpp, right_pool.cpp). Just change <torch/torch.h> to <torch/extension.h> will fix it.
from cornernet-lite.
D:\Python\Python36\lib\site-packages\torch\lib\include\torch\csrc\api\include\torch/torch.h(7): fatal error C1021: invalid preprocessor command 'warning'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2
I have met the same problem. And couldn't solve it. Anyone can help me? tks.
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2
from cornernet-lite.
modify core\external\setup.py
change all extra_compile_args=["-Wno-cpp", "-Wno-unused-function"] to extra_compile_args={'gcc': ['/Qstd=c99']}
and run command ‘python setup.py build_ext --inplace’
but pycocotools for windows is required
https://github.com/binhbumpro/pycocotools-window
from cornernet-lite.
We only tested CornerNet-Lite on Linux and we don't have a Windows machine so I am not sure if the code will run properly on Windows 10.
from cornernet-lite.
D:\Python\Python36\lib\site-packages\torch\lib\include\torch\csrc\api\include\torch/torch.h(7): fatal error C1021: invalid preprocessor command 'warning'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe' failed with exit status 2
from cornernet-lite.
okay. I find the problem and solve it from the Pull requests.
modify the four cpp files(bottom_pool.cpp, left_pool.cpp, top_pool.cpp, right_pool.cpp). Just change <torch/torch.h> to <torch/extension.h> will fix it.
===========
1.modify the four cpp files(bottom_pool.cpp, left_pool.cpp, top_pool.cpp, right_pool.cpp). Just change <torch/torch.h> to <torch/extension.h>
2.Also, insted install into user directory, we can build develop insted :
#python setup.py install --user
python setup.py build develop
THX!!!!
from cornernet-lite.
I have met the same problem. And when I modify the four cpp files(bottom_pool.cpp, left_pool.cpp, top_pool.cpp, right_pool.cpp). Just change <torch/torch.h> to <torch/extension.h>,the other error occured: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe' failed with exit status 1171. Can you tell me how to solve it?
from cornernet-lite.
I have met the same problem. And when I modify the four cpp files(bottom_pool.cpp, left_pool.cpp, top_pool.cpp, right_pool.cpp). Just change <torch/torch.h> to <torch/extension.h>,the other error occured: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe' failed with exit status 1171. Can you tell me how to solve it?
from cornernet-lite.
thx all, i've changed os to CentOS, but i'll try win10 again
from cornernet-lite.
Compiling NMS
Compile the NMS code which are originally from Faster R-CNN and Soft-NMS.
cd /core/external
make
D:\Tensorflow\pytorch\CornerNet-Lite\core\external>make
python setup.py build_ext --inplace
Compiling bbox.pyx because it changed.
Compiling nms.pyx because it changed.
[1/2] Cythonizing bbox.pyx
D:\Program Files\Python368\lib\site-packages\Cython\Compiler\Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: D:\Tensorflow\pytorch\CornerNet-Lite\core\external\bbox.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
[2/2] Cythonizing nms.pyx
D:\Program Files\Python368\lib\site-packages\Cython\Compiler\Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: D:\Tensorflow\pytorch\CornerNet-Lite\core\external\nms.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
running build_ext
building 'bbox' extension
creating build
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-ID:\Program Files\Python368\lib\site-packages\numpy\core\include" "-ID:\Program Files\Python368\include" "-ID:\Program Files\Python368\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcbbox.c /Fobuild\temp.win-amd64-3.6\Release\bbox.obj -Wno-cpp -Wno-unused-function
cl: 命令行 error D8021 :无效的数值参数“/Wno-cpp”
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit status 2
make: *** [Makefile:2: all] Error 1
=================
Anyone solved bbox and nms-gpu in win10?
from cornernet-lite.
https://blog.csdn.net/qq_41895190/article/details/82877883
cl: 命令行 error D8021 :无效的数值参数“/Wno-cpp”
==============
okay. I find the problem and solve it.
是因为pycocotools不支持windows。 Because pycocotools does not support windows.
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
打印出如下信息,已经安装成功了。
C:\Users\TengLong>pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
Cloning https://github.com/philferriere/cocoapi.git to c:\users\tenglong\appdata\local\temp\pip-req-build-pkksskme
Requirement already satisfied (use --upgrade to upgrade): pycocotools==2.0 from git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI in d:\program files\python368\lib\site-packages
Building wheels for collected packages: pycocotools
Building wheel for pycocotools (setup.py) ... done
Stored in directory: C:\Users\TengLong\AppData\Local\Temp\pip-ephem-wheel-cache-__zczn1n\wheels\69\2b\12\2fa959e49f73d26cff202c2f4e5079096c9c57c8a8509fd75c
Successfully built pycocotools
================
"D:\Program Files\Python368\python.exe" D:/Tensorflow/pytorch/CornerNet-Lite/demo.py
total parameters: 116969339
loading from D:\Tensorflow\pytorch\CornerNet-Lite\core..\cache\nnet\CornerNet_Saccade\CornerNet_Saccade_500000.pkl
from cornernet-lite.
python setup.py build_ext --inplace
Compiling NMS
Compile the NMS code which are originally from Faster R-CNN and Soft-NMS.cd /core/external
make
D:\Tensorflow\pytorch\CornerNet-Lite\core\external>make
python setup.py build_ext --inplace
Compiling bbox.pyx because it changed.
Compiling nms.pyx because it changed.
[1/2] Cythonizing bbox.pyx
D:\Program Files\Python368\lib\site-packages\Cython\Compiler\Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: D:\Tensorflow\pytorch\CornerNet-Lite\core\external\bbox.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
[2/2] Cythonizing nms.pyx
D:\Program Files\Python368\lib\site-packages\Cython\Compiler\Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: D:\Tensorflow\pytorch\CornerNet-Lite\core\external\nms.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
running build_ext
building 'bbox' extension
creating build
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-ID:\Program Files\Python368\lib\site-packages\numpy\core\include" "-ID:\Program Files\Python368\include" "-ID:\Program Files\Python368\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcbbox.c /Fobuild\temp.win-amd64-3.6\Release\bbox.obj -Wno-cpp -Wno-unused-function
cl: 命令行 error D8021 :无效的数值参数“/Wno-cpp”
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe' failed with exit status 2
make: *** [Makefile:2: all] Error 1=================
Anyone solved bbox and nms-gpu in win10?
**
change all extra_compile_args=["-Wno-cpp", "-Wno-unused-function"] to extra_compile_args={'gcc': ['/Qstd=c99']}
and run command ‘python setup.py build_ext --inplace’
but pycocotools for windows is required
https://github.com/binhbumpro/pycocotools-window
**
from cornernet-lite.
win10 omg
RuntimeError: Dimension out of range (expected to be in range of [-4, 3], but got 2559800508416) (maybe_wrap_dim at ..\aten\src\ATen/core/WrapDimMinimal.h:18)
(no backtrace available)
from cornernet-lite.
Anyone solved bbox and nms-gpu in win10?
from cornernet-lite.
Anyone solved bbox and nms-gpu in win10?
modify core\external\setup.py
change all extra_compile_args=["-Wno-cpp", "-Wno-unused-function"] to extra_compile_args={'gcc': ['/Qstd=c99']}
and run command ‘python setup.py build_ext --inplace’
but pycocotools for windows is required
https://github.com/binhbumpro/pycocotools-window
It can probably solve bbox-nms problem.
But when running it in win10,I find CornerNet-Squeeze is slower than yolov3.
from cornernet-lite.
Anyone solved bbox and nms-gpu in win10?
I solve this soft-nms problem, I wirte a new function(pure python) replace the orign one.
我写了一个一个python 程序替代了原来的soft_nms
this function is a little different from orign one, it return two objects:
def soft_nms(boxes: np.ndarray,
sigma: float = 0.5,
Nt: float = 0.3,
threshold: float = 0.001,
method: int = 0):
"""
:param boxes: 要求两个维度[n,8] n个boxes
:param sigma:
:param Nt: iou的阈值
:param threshold:
:param method:
:return:
"""
n = np.shape(boxes)[0] # 多少个box
if n == 0:
return None, np.zeros((0, 5))
for i in range(n):
# 遍历boxes数组中的每个box, 指针每指向一个box后,
# 这个box会和数组后面的全部box(index比他大的box)做比较, 找到得分最大的box
# 用最大box坐标信息和得分与当前指针位置的box的坐标信息和得分,互相交换
# 然后指针后移开始计算下一个box
maxscore = boxes[i, 4] # index = 4 的位置上是 box的得分
maxpos = i # 最大得分的位置
tx1 = boxes[i, 0]
ty1 = boxes[i, 1]
tx2 = boxes[i, 2]
ty2 = boxes[i, 3]
ts = boxes[i, 4]
pos = i + 1
# get max box, 通过while循环, 找到index:i与boxes数组后面部分的最大得分的box的index和最大得分
while pos < n:
if maxscore < boxes[pos, 4]:
maxscore = boxes[pos, 4]
maxpos = pos
pos = pos + 1
# add max box as a detection,
# 把最大得分的box信息和当前指针位置的box信息互相交换
boxes[i, 0] = boxes[maxpos, 0]
boxes[i, 1] = boxes[maxpos, 1]
boxes[i, 2] = boxes[maxpos, 2]
boxes[i, 3] = boxes[maxpos, 3]
boxes[i, 4] = boxes[maxpos, 4]
# swap ith box with position of max box
boxes[maxpos, 0] = tx1
boxes[maxpos, 1] = ty1
boxes[maxpos, 2] = tx2
boxes[maxpos, 3] = ty2
boxes[maxpos, 4] = ts
pos = i + 1 # 重置pos 为i的下一个index
while pos < n:
x1 = boxes[pos, 0]
y1 = boxes[pos, 1]
x2 = boxes[pos, 2]
y2 = boxes[pos, 3]
s = boxes[pos, 4]
area = (x2 - x1 + 1) * (y2 - y1 + 1) #
iw = (min(tx2, x2) - max(tx1, x1) + 1) #
if iw > 0: # iw >0,ih>0 pos位置的box与i位置的box是相交的
ih = (min(ty2, y2) - max(ty1, y1) + 1) #
if ih > 0:
ua = float((tx2 - tx1 + 1) * (ty2 - ty1 + 1) + area - iw * ih)
#
ov = iw * ih / ua # iou between max box and detection box iou
if method == 1: # linear
if ov > Nt:
weight = 1 - ov
else:
weight = 1
elif method == 2: # gaussian 默认选择
weight = np.exp(-(ov * ov) / sigma)
else: # original NMS
if ov > Nt:
weight = 0
else:
weight = 1
# weight
# 对pos 位置的box的得分进行修改
boxes[pos, 4] = weight * boxes[pos, 4]
# if box score falls below threshold, discard the box by swapping with last box
# update n 如果box的得分经过抑制后低于设置的阈值,抛弃这个box, 使用数组中的最后一个box的信息做替换
if boxes[pos, 4] < threshold:
boxes[pos, 0] = boxes[n - 1, 0]
boxes[pos, 1] = boxes[n - 1, 1]
boxes[pos, 2] = boxes[n - 1, 2]
boxes[pos, 3] = boxes[n - 1, 3]
boxes[pos, 4] = boxes[n - 1, 4]
n = n - 1
pos = pos - 1
pos = pos + 1
keep = [i for i in range(n)]
return keep, boxes
and you need change code(cornernet_saccade.py) in the same place where function soft_nms is used.
..........
top_bboxes = {} # {类别id:boxes(8个坐标的)}
for j in range(categories):
keep_inds = (classes == j)
top_bboxes[j + 1] = detections[keep_inds][:, 0:7].astype(np.float32)
# 预测的最后调用了 soft_nms # 这里需要修改, 传入的是8个坐标的boxes
keep_inds, after_nms_boxes = soft_nms(top_bboxes[j + 1], Nt=nms_threshold, method=nms_algorithm, sigma=0.7)
# print(keep_inds)
# print(after_nms_boxes)
# print(type(keep_inds))
# print("===============")
if keep_inds is not None:
one_boxes = []
for one_keep_index in keep_inds:
one_box = after_nms_boxes[one_keep_index]
one_boxes.append(one_box[0:5])
else:
one_boxes = after_nms_boxes
# top_bboxes[j + 1] = top_bboxes[j + 1][keep_inds, 0:5] # 4个坐标 + 上点和下点的平均分类得分
top_bboxes[j + 1] = np.array(one_boxes) # 4个坐标 + 上点和下点的平均分类得分
.......
from cornernet-lite.
Anyone solved bbox and nms-gpu in win10?
yes it solved
from cornernet-lite.
Anyone solved bbox and nms-gpu in win10?
yes it solved
from cornernet-lite.
We only tested CornerNet-Lite on Linux and we don't have a Windows machine so I am not sure if the code will run properly on Windows 10.
Hello,when i python train.py,have a error.
cfg_file = os.path.join(system_configs.config_dir, args.cfg_file + ".json") TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Can you help me?thank you.
from cornernet-lite.
Related Issues (20)
- Using a data set with only one category, Loss dropped to 0.003, but when testing, ap = -1 HOT 1
- AttributeError: 'builtin_function_or_method' object has no attribute 'view' HOT 1
- ModuleNotFoundError: No module named 'core' HOT 3
- Has anyone use another backbone networks to test the performance?
- About "add downsampling lyaer before the hourglass module and remove one in hourglass modue" HOT 1
- train error
- When I testing my own data, occur No module named 'test.xxx'
- The network architecture of CornerNet-Saccade
- Can not create the envs on the first step, list many config package when created from file conda_packagelist.txt Please help me!! HOT 1
- Duplicated boxes during soft_nms HOT 1
- some training issue HOT 1
- some questions about the structure of cornerNet-saccade HOT 1
- when run the demo.py, the program is stuck
- 0%| | 0/90000 [00:00<?, ?it/s]段错误(吐核)
- ImportError undefined symbol: _ZNSt19basic_ostringstreamIcSt11char_traitsIcESaIcEEC1Ev HOT 1
- When I train the model on my own dataset, I met IndexError in cornernet_saccade.py HOT 1
- error while tarining on my new dataset which has same COCO format HOT 1
- A small running error
- About the software requirements HOT 1
- [W Resize.cpp:19] Warning: An output with one or more elements was resized since it had shape [16263], which does not match the required output shape [14926].This behavior is deprecated, and in a future PyTorch release outputs will not be resized unless they have zero elements. You can explicitly reuse an out tensor t by resizing it, inplace, to zero elements with t.resize_(0). (function resize_output) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cornernet-lite.