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

TypeError: 'NoneType' object is not callable #56

Open
liu-ca opened this issue Oct 30, 2019 · 9 comments
Open

TypeError: 'NoneType' object is not callable #56

liu-ca opened this issue Oct 30, 2019 · 9 comments

Comments

@liu-ca
Copy link

liu-ca commented Oct 30, 2019

When I run this code,
image

@skx6
Copy link

skx6 commented Dec 18, 2019

The same problem! Have you solved yet?

@skx6
Copy link

skx6 commented Dec 18, 2019

I finally solved the problem by changing codes in "model_search.py":

    for i in range(self._steps):
        for j in range(2 + i):
            stride = 1
            if C_prev_prev == -1 and j == 0:
                op = None
            else:
                op = MixedOp(self.C_out, stride)
            self._ops.append(op)

@GuHuangAI
Copy link

I finally solved the problem by changing codes in "model_search.py":
for i in range(self._steps):
for j in range(2 + i):
stride = 1
if C_prev_prev == -1 and j == 0:
op = None
else:
op = MixedOp(self.C_out, stride)
self._ops.append(op)

it's useful, and then i get a new issue:RuntimeError: CUDA out of memory. i run on pascal dataset, could you help me?

@tuanhui-li
Copy link

I finally solved the problem by changing codes in "model_search.py":
for i in range(self._steps):
for j in range(2 + i):
stride = 1
if C_prev_prev == -1 and j == 0:
op = None
else:
op = MixedOp(self.C_out, stride)
self._ops.append(op)

it's useful, and then i get a new issue:RuntimeError: CUDA out of memory. i run on pascal dataset, could you help me?
Hello ! Have you solved yet?

@GuHuangAI
Copy link

GuHuangAI commented Mar 27, 2020 via email

@NdaAzr
Copy link

NdaAzr commented May 2, 2020

I am getting the same error for my custom dataset. has anyone solved this issue?
@Songkaixiang how you did solve the problem? I used your snippet, and I got this error.

File "C:\AutoDeeplab-master\model_search.py", line 71, in forward
    s = sum(self._ops[offset+j](h, weights[offset+j]) for j, h in enumerate(states) if h is not None)

  File "C:\AutoDeeplab-master\model_search.py", line 71, in <genexpr>
    s = sum(self._ops[offset+j](h, weights[offset+j]) for j, h in enumerate(states) if h is not None)

  File "C:\Users\user\Anaconda3\lib\site-packages\torch\nn\modules\container.py", line 138, in __getitem__
    return self._modules[self._get_abs_string_index(idx)]

  File "C:\Users\user\Anaconda3\lib\site-packages\torch\nn\modules\container.py", line 129, in _get_abs_string_index
    raise IndexError('index {} is out of range'.format(idx))

IndexError: index 15 is out of range

@rrryan2016
Copy link

the best way is to use a GPU that has enough memory.

------------------ 原始邮件 ------------------ 发件人: "tuanhui-li"<notifications@github.com>; 发送时间: 2020年3月27日(星期五) 下午4:33 收件人: "MenghaoGuo/AutoDeeplab"<AutoDeeplab@noreply.github.com>; 抄送: "醉生 s& 梦 死"<1654592024@qq.com>; "Comment"<comment@noreply.github.com>; 主题: Re: [MenghaoGuo/AutoDeeplab] TypeError: 'NoneType' object is not callable (#56) I finally solved the problem by changing codes in "model_search.py": for i in range(self._steps): for j in range(2 + i): stride = 1 if C_prev_prev == -1 and j == 0: op = None else: op = MixedOp(self.C_out, stride) self._ops.append(op) it's useful, and then i get a new issue:RuntimeError: CUDA out of memory. i run on pascal dataset, could you help me? Hello ! Have you solved yet? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Heyyyy! Which gpu did you use to run it? I used 4 TITAN X (pascal), each memory is 11.2GB, but still "CUDA out of memory".

I doubt it could be some mistake in distributed computing, what I mainly did in parallel is
self.model = torch.nn.DataParallel(self.model, device_ids=[0, 1, 2, 3])

@rogressing
Copy link

I finally solved the problem by changing codes in "model_search.py":
for i in range(self._steps):
for j in range(2 + i):
stride = 1
if C_prev_prev == -1 and j == 0:
op = None
else:
op = MixedOp(self.C_out, stride)
self._ops.append(op)

it's useful, and then i get a new issue:RuntimeError: CUDA out of memory. i run on pascal dataset, could you help me?
Hello, I followed your method, but still prompted a problem, I would like to ask if I can see how your file is modified, can you have a screenshot of the changes to view it, if you can reply to me, it would be very helpful to me.Thank you !

@Randylcy
Copy link
Contributor

Randylcy commented Apr 6, 2023 via email

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

No branches or pull requests

8 participants