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

jittor.nn.Upsample设定的默认值无法正常运行 #450

Closed
PhyllisJi opened this issue Jun 16, 2023 · 0 comments
Closed

jittor.nn.Upsample设定的默认值无法正常运行 #450

PhyllisJi opened this issue Jun 16, 2023 · 0 comments

Comments

@PhyllisJi
Copy link

Describe the bug

当使用Upsample的默认取值时,它会无法正常工作并报错
检查源代码发现,接口Upsample的其中一个参数被默认设置为None,但是None无法完成接口中的运算

Full Log

x = jittor.randn(3,32,32)
p = jittor.nn.Upsample()
y = p(x)
Traceback (most recent call last)
TypeError Cell In[5],Line 1
p(x)---->1y=_init__py:
,in Module.call(self,*args File \AppData\Local\Programs\Python\Python310\Lib\site-packages\jittor**kw)
def call(self, *args, **kw):->
return self.execute(*args,**kw)
File
\AppData\Local\Programs\Python\Python310\Lib\site-packages\jittor\nn.py:2160,in Upsample.execute(self,x)
def execute(self,x):2158
return upsample(x,
size=(2159
int(x.shape [2]*self.scale_factor [0]),
int(x.shape[3]*self.scale_factor[1])
mode=self.mode)
TypeError:unsupported operand type(s)for *:'int'and 'NoneType'

Minimal Reproduce

x = jittor.randn(3, 3, 32, 32)
p = jittor.nn.Upsample()
y = p(x)

Expected behavior

Upsample正常工作

If you are submitting an issue for the first time, please refer to our guideline

Hanyx2021 added a commit to Hanyx2021/jittor that referenced this issue May 30, 2024
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

2 participants