ensemble-boxes是CVPR2020年发表的Weight Boxes Fusion论文中提出算法的作者开源的第三方库。
里面实现了WBF后处理算法s
具体的请见github:https://github.com/ZFTurbo/Weighted-Boxes-Fusion
arxiv:https://arxiv.org/abs/1910.13302
如果直接pip install ensemble-boxes报错的话,
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting ensemble-boxes
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/81/2d/f9ff1e2d6e7b5cc0279e7146b4bcd7b17292872a81314b75ced5706c36a5/ensemble_boxes-1.0.6-py3-none-any.whl (20 kB)
Requirement already satisfied: pandas in /home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages (from ensemble-boxes) (1.2.3)
Requirement already satisfied: numpy in /home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages (from ensemble-boxes) (1.20.1)
Collecting numba
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f2/e9/cfcbf8c85d99cbdb68619c4c78f3d76d5f5e4829c5f2534422dcd960d355/numba-0.53.1-cp38-cp38-manylinux2014_x86_64.whl (3.4 MB)
|████████████████████████████████| 3.4 MB 280 kB/s
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/llvmlite/
Collecting llvmlite<0.37,>=0.36.0rc1
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/28/7c/a0b7cc59f4c2d46347f46a2aa687cb96d3fe45a6750cd1fc7e69541a5462/llvmlite-0.36.0-cp38-cp38-manylinux2010_x86_64.whl (25.3 MB)
| | 10 kB 16.5 MB/s eta 0:00:02ERROR: Exception:
Traceback (most recent call last):
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 171, in _merge_into_criterion
crit = self.state.criteria[name]
KeyError: 'llvmlite'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 438, in _error_catcher
yield
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/http/client.py", line 458, in read
n = self.readinto(b)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/http/client.py", line 502, in readinto
n = self.fp.readinto(b)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
status = self.run(options, args)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
return func(self, options, args)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 316, in run
requirement_set = resolver.resolve(
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 121, in resolve
self._result = resolver.resolve(
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 453, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 347, in resolve
failure_causes = self._attempt_to_pin_criterion(name, criterion)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 207, in _attempt_to_pin_criterion
criteria = self._get_criteria_to_update(candidate)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 199, in _get_criteria_to_update
name, crit = self._merge_into_criterion(r, parent=candidate)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _merge_into_criterion
crit = Criterion.from_requirement(self._p, requirement, parent)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 82, in from_requirement
if not cands:
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/resolvelib/structs.py", line 124, in __bool__
return bool(self._sequence)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in __bool__
return any(self)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 38, in _iter_built
candidate = func()
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 167, in _make_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 300, in __init__
super().__init__(
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 144, in __init__
self.dist = self._prepare()
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 226, in _prepare
dist = self._prepare_distribution()
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 311, in _prepare_distribution
return self._factory.preparer.prepare_linked_requirement(
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 457, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 480, in _prepare_linked_requirement
local_file = unpack_url(
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 230, in unpack_url
file = get_http_url(
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/operations/prepare.py", line 108, in get_http_url
from_path, content_type = download(link, temp_dir.path)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/network/download.py", line 163, in __call__
for chunk in chunks:
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/cli/progress_bars.py", line 159, in iter
for x in it:
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_internal/network/utils.py", line 64, in response_chunks
for chunk in response.raw.stream(
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 576, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 541, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "/home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages/pip/_vendor/urllib3/response.py", line 443, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Read timed out.
经过网上搜索,得出的结论有:
首先要更新pip
pip install --upgrade pip
其次要更新setuptools
pip install --upgrade setuptools
这两个更新了之后再次pip install ensemble-boxes,就不会报错了。
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting ensemble-boxes
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/81/2d/f9ff1e2d6e7b5cc0279e7146b4bcd7b17292872a81314b75ced5706c36a5/ensemble_boxes-1.0.6-py3-none-any.whl (20 kB)
Requirement already satisfied: numpy in /home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages (from ensemble-boxes) (1.20.1)
Collecting numba
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f2/e9/cfcbf8c85d99cbdb68619c4c78f3d76d5f5e4829c5f2534422dcd960d355/numba-0.53.1-cp38-cp38-manylinux2014_x86_64.whl (3.4 MB)
Requirement already satisfied: pandas in /home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages (from ensemble-boxes) (1.2.3)
Requirement already satisfied: setuptools in /home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages (from numba->ensemble-boxes) (54.2.0)
Collecting llvmlite<0.37,>=0.36.0rc1
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/28/7c/a0b7cc59f4c2d46347f46a2aa687cb96d3fe45a6750cd1fc7e69541a5462/llvmlite-0.36.0-cp38-cp38-manylinux2010_x86_64.whl (25.3 MB)
|████████████████████████████████| 25.3 MB 342 kB/s
Requirement already satisfied: pytz>=2017.3 in /home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages (from pandas->ensemble-boxes) (2021.1)
Requirement already satisfied: python-dateutil>=2.7.3 in /home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages (from pandas->ensemble-boxes) (2.8.1)
Requirement already satisfied: six>=1.5 in /home/zkti/anaconda3/envs/torch3.8/lib/python3.8/site-packages (from python-dateutil>=2.7.3->pandas->ensemble-boxes) (1.15.0)
Installing collected packages: llvmlite, numba, ensemble-boxes
Successfully installed ensemble-boxes-1.0.6 llvmlite-0.36.0 numba-0.53.1