Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uint8 fix #2105

Merged
merged 3 commits into from
Feb 17, 2020
Merged

Uint8 fix #2105

merged 3 commits into from
Feb 17, 2020

Conversation

ZwwWayne
Copy link
Collaborator

Fix #2017
In PyTorch 1.4, using tensor of type torch.uint8 will cause a massive warning.
To avoid that, the inside_flags is converted to bool type. However, Tensor.bool() is not supported in the PyTorch 1.1, the and operation is also invalid for bool tensor, as well as .any().
Therefore, we use tensor.type(torch.bool) here.
The modification has been tested with two environments: PyTorch 1.1 & PyTorch 1.4.

@hellock hellock merged commit 02ee4e1 into open-mmlab:master Feb 17, 2020
mattdawkins added a commit to VIAME/mmdetection that referenced this pull request Feb 26, 2020
* jon/dev/fix_fpn2: (33 commits)
  Fix FPN upscale
  fix analyze log (open-mmlab#2150)
  Fix a documentation error in GETTING_STARTED.md (open-mmlab#2149)
  add optimizer registry (open-mmlab#2139)
  Update version to 1.1 (open-mmlab#2144)
  Fix IOU assigners when ignore_of_thr > 0 and no pred boxes (open-mmlab#2135)
  reset worker_seed (open-mmlab#2111)
  Fix issue with list of metrics in CustomDataset.evaluate (open-mmlab#2128)
  Code Release: CARAFE: Content-Aware ReAssembly of FEatures (ICCV 2019) (open-mmlab#1583)
  fixed test package (open-mmlab#2127)
  add an argument format-only to handle the json formating (open-mmlab#2114)
  fix (get_cls_results): use np.empty for empty bbox rather than np.arrary (open-mmlab#2116)
  fix (dpool): directly return empty if rois's length is 0 (open-mmlab#2099)
  fix workflow problem (open-mmlab#2103)
  Uint8 fix (open-mmlab#2105)
  Fix device bug (open-mmlab#2098)
  fix test ddp initialize (open-mmlab#2100)
  set FORCE_CUDA (open-mmlab#2097)
  Speed up sampler (open-mmlab#2094)
  Use official DDP to implement MMDDP (open-mmlab#2090)
  ...
@wduo
Copy link

wduo commented Feb 28, 2020

In PYTORCH="1.3" ARG CUDA="10.1" ARG CUDNN="7", there are still massive warnings here.
How can I fix it?

@wduo
Copy link

wduo commented Feb 28, 2020

@ZwwWayne

@ZwwWayne
Copy link
Collaborator Author

ZwwWayne commented Mar 2, 2020

In PYTORCH="1.4" there is no warning, I will also try your environments to see what happened.

@iamryanchia
Copy link

In pytorch 1.4, training with config "cascade_rcnn_r101_fpn_1x.py" still exist this warnings.

@EvenStrangest
Copy link

The below task also produces this error.

root@1bac3eaaf785:/mmdetection# python tools/train.py configs/htc/htc_x101_64x4d_fpn_20e_16gpu.py
2020-03-10 14:49:23,916 - mmdet - INFO - Environment info:
------------------------------------------------------------
TorchVision: 0.4.1a0+d94043a
OpenCV: 4.2.0
MMCV: 0.3.2
MMDetection: 1.1.0+e08a1ee
MMDetection Compiler: GCC 5.4
MMDetection CUDA Compiler: 10.1

@xvjiarui xvjiarui mentioned this pull request Mar 11, 2020
mattdawkins added a commit to VIAME/mmdetection that referenced this pull request Mar 13, 2020
* tag 'v1.1.0': (29 commits)
  Update version to 1.1 (open-mmlab#2144)
  Fix IOU assigners when ignore_of_thr > 0 and no pred boxes (open-mmlab#2135)
  reset worker_seed (open-mmlab#2111)
  Fix issue with list of metrics in CustomDataset.evaluate (open-mmlab#2128)
  Code Release: CARAFE: Content-Aware ReAssembly of FEatures (ICCV 2019) (open-mmlab#1583)
  fixed test package (open-mmlab#2127)
  add an argument format-only to handle the json formating (open-mmlab#2114)
  fix (get_cls_results): use np.empty for empty bbox rather than np.arrary (open-mmlab#2116)
  fix (dpool): directly return empty if rois's length is 0 (open-mmlab#2099)
  fix workflow problem (open-mmlab#2103)
  Uint8 fix (open-mmlab#2105)
  Fix device bug (open-mmlab#2098)
  fix test ddp initialize (open-mmlab#2100)
  set FORCE_CUDA (open-mmlab#2097)
  Speed up sampler (open-mmlab#2094)
  Use official DDP to implement MMDDP (open-mmlab#2090)
  log meta (open-mmlab#2086)
  fix pad_val not used in class Pad when pad to a fixed size (open-mmlab#2093)
  remove cython docs (open-mmlab#2091)
  remove new_tensor (open-mmlab#2092)
  ...
ioir123ju pushed a commit to ioir123ju/mmdetection that referenced this pull request Mar 30, 2020
* fix (uint8 index warning): use bool for inside flags

* fix (unint8 index): convert to bool in the final to avoid 1.1 constriant

* fix (unmap): convert inds in unmap to be bool type
@ZwwWayne ZwwWayne deleted the uint8-fix branch April 22, 2020 05:19
mike112223 pushed a commit to mike112223/mmdetection that referenced this pull request Aug 25, 2020
* fix (uint8 index warning): use bool for inside flags

* fix (unint8 index): convert to bool in the final to avoid 1.1 constriant

* fix (unmap): convert inds in unmap to be bool type
FANGAreNotGnu pushed a commit to FANGAreNotGnu/mmdetection that referenced this pull request Oct 23, 2023
jben-hun pushed a commit to jben-hun/mmdetection that referenced this pull request Jan 10, 2025
* fix (uint8 index warning): use bool for inside flags

* fix (unint8 index): convert to bool in the final to avoid 1.1 constriant

* fix (unmap): convert inds in unmap to be bool type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead
5 participants