Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

AttributeError: 'NoneType' object has no attribute 'split' #802

Open
donglin-wang opened this issue May 20, 2019 · 5 comments · Fixed by NVIDIA/apex#516
Open

AttributeError: 'NoneType' object has no attribute 'split' #802

donglin-wang opened this issue May 20, 2019 · 5 comments · Fixed by NVIDIA/apex#516

Comments

@donglin-wang
Copy link

❓ Questions and Help

I have installed the repo following the instruction on INSTALL.md. When I was following this instruction for installing apex, I used "python setup.py install" instead of "python setup.py install --cuda_ext --cpp_ext", as suggested in this issue. When I try to run the demo, I get the following error

(maskrcnn_benchmark) ParisdeMacBook-Air:demo paris$ python webcam.py --min-image-size 300 MODEL.DEVICE cpu
Traceback (most recent call last):
File "webcam.py", line 6, in
from predictor import COCODemo
File "/Users/paris/maskrcnn-benchmark/demo/predictor.py", line 6, in
from maskrcnn_benchmark.modeling.detector import build_detection_model
File "/Users/paris/maskrcnn-benchmark/maskrcnn_benchmark/modeling/detector/init.py", line 2, in
from .detectors import build_detection_model
File "/Users/paris/maskrcnn-benchmark/maskrcnn_benchmark/modeling/detector/detectors.py", line 2, in
from .generalized_rcnn import GeneralizedRCNN
File "/Users/paris/maskrcnn-benchmark/maskrcnn_benchmark/modeling/detector/generalized_rcnn.py", line 11, in
from ..backbone import build_backbone
File "/Users/paris/maskrcnn-benchmark/maskrcnn_benchmark/modeling/backbone/init.py", line 2, in
from .backbone import build_backbone
File "/Users/paris/maskrcnn-benchmark/maskrcnn_benchmark/modeling/backbone/backbone.py", line 7, in
from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform
File "/Users/paris/maskrcnn-benchmark/maskrcnn_benchmark/modeling/make_layers.py", line 10, in
from maskrcnn_benchmark.layers import Conv2d
File "/Users/paris/maskrcnn-benchmark/maskrcnn_benchmark/layers/init.py", line 10, in
from .nms import nms
File "/Users/paris/maskrcnn-benchmark/maskrcnn_benchmark/layers/nms.py", line 5, in
from apex import amp
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in _load_unlocked
File "", line 638, in _load_backward_compatible
File "/Users/paris/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/apex-0.1-py3.7.egg/apex/init.py", line 2, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in _load_unlocked
File "", line 638, in _load_backward_compatible
File "/Users/paris/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/apex-0.1-py3.7.egg/apex/amp/init.py", line 1, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in _load_unlocked
File "", line 638, in _load_backward_compatible
File "/Users/paris/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/apex-0.1-py3.7.egg/apex/amp/amp.py", line 3, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in _load_unlocked
File "", line 638, in _load_backward_compatible
File "/Users/paris/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/apex-0.1-py3.7.egg/apex/amp/lists/torch_overrides.py", line 69, in
File "/Users/paris/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/apex-0.1-py3.7.egg/apex/amp/utils.py", line 9, in get_cuda_version
AttributeError: 'NoneType' object has no attribute 'split'

Can anyone help me figure this out?

@RhodaLiu17
Copy link

I have the same problem as you. But then I realize that I download CPU version of pytorch-nightly, so it can't find my GPU.
Then I download GPU version of pytorch-nightly again at this website
https://anaconda.org/pytorch
Because the pip way is too slow for me, so I download .tar.bz2. Notice NOT to choose CPU!
And now it works. I hope this will be helpful!

@14211019
Copy link

I also faced this problem too,and I find the apex/amp/lists/torch._overrides.py and its 69 row is to get a GPU version ,I # it and this problem has been solved. Hope helpful for you.

@aashish-0393
Copy link

Hi.
in case of inference on CPU on machine, getting below error :

from predictor import COCODemo

error:
AttributeError: 'NoneType' object has no attribute 'split'

@xkyi
Copy link

xkyi commented Jun 28, 2019

comment:

# if version_num < 1.1:
    # FP32_FUNCS.append('mean')


# if utils.get_cuda_version() >= (9, 1, 0):
    # FP16_FUNCS.extend(_bmms)
# else:
    # FP32_FUNCS.extend(_bmms)

@BystanderJ
Copy link

I also faced this problem too,and I # (.apex/amp/lists/torch._overrides.py) 77-80 rows; and # (.apex/amp/utils.py) 8-9 rows. Then the problem was sloved, hope it's helpful for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants