Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Change links to override forward #835

Merged
merged 5 commits into from
Mar 25, 2019
Merged

Conversation

crcrpar
Copy link
Contributor

@crcrpar crcrpar commented Mar 17, 2019

No description provided.

@knorth55
Copy link
Contributor

From which version can we use forward function?

@crcrpar
Copy link
Contributor Author

crcrpar commented Mar 17, 2019

@yuyu2172
Copy link
Member

pfnCI, test this please

@pfn-ci-bot
Copy link
Collaborator

Successfully created a job for commit f7b1368:

@knorth55 knorth55 added this to the 0.13 milestone Mar 18, 2019
@yuyu2172
Copy link
Member

Please fix these errors.


2019-03-18 11:10:02.161407 STDOUT 2074] | def _predict(self, imgs):
-- | --
2019-03-18 11:10:02.161414 STDOUT 2074] | xs = chainer.Variable(self.xp.asarray(imgs))
2019-03-18 11:10:02.161421 STDOUT 2074] | with chainer.using_config('train', False):
2019-03-18 11:10:02.161427 STDOUT 2074] | >           scores = F.softmax(self.forward(xs)).array
2019-03-18 11:10:02.161434 STDOUT 2074] | E           AttributeError: Parameterized test failed.
2019-03-18 11:10:02.161440 STDOUT 2074] | E
2019-03-18 11:10:02.161448 STDOUT 2074] | E           Base test method: TestPSPNetResNet.test_predict_gpu
2019-03-18 11:10:02.161455 STDOUT 2074] | E           Test parameters:
2019-03-18 11:10:02.161486 STDOUT 2074] | E             model: <class 'chainercv.experimental.links.model.pspnet.pspnet.PSPNetResNet50'>
2019-03-18 11:10:02.161524 STDOUT 2074] | E
2019-03-18 11:10:02.161533 STDOUT 2074] | E
2019-03-18 11:10:02.161539 STDOUT 2074] | E           (caused by)
2019-03-18 11:10:02.161546 STDOUT 2074] | E           AttributeError: 'PSPNetResNet101' object has no attribute 'forward'

2019-03-18 11:10:02.494948 STDOUT 2074] | self = <chainercv.experimental.links.model.pspnet.pspnet.PSPNetResNet50 object at 0x7f88b82a05d0>
-- | --
2019-03-18 11:10:02.494955 STDOUT 2074] | imgs = array([[[[   0.       ,    0.       ,    0.       , ...,    0.       ,
2019-03-18 11:10:02.494962 STDOUT 2074] | ...  , ...,   39.060997 ,
2019-03-18 11:10:02.494969 STDOUT 2074] | 128.061    ,  -56.939003 ]]]], dtype=float32)
2019-03-18 11:10:02.494975 STDOUT 2074] |  
2019-03-18 11:10:02.494976 STDOUT 2074] | def _predict(self, imgs):
2019-03-18 11:10:02.494982 STDOUT 2074] | xs = chainer.Variable(self.xp.asarray(imgs))
2019-03-18 11:10:02.494988 STDOUT 2074] | with chainer.using_config('train', False):
2019-03-18 11:10:02.494994 STDOUT 2074] | >           scores = F.softmax(self.forward(xs)).array
2019-03-18 11:10:02.495000 STDOUT 2074] | E           AttributeError: Parameterized test failed.
2019-03-18 11:10:02.495006 STDOUT 2074] | E
2019-03-18 11:10:02.495012 STDOUT 2074] | E           Base test method: TestPSPNetResNet.test_predict_gpu
2019-03-18 11:10:02.495018 STDOUT 2074] | E           Test parameters:
2019-03-18 11:10:02.734602 STDOUT 2074] | E             model: <class 'chainercv.experimental.links.model.pspnet.pspnet.PSPNetResNet50'>
2019-03-18 11:10:02.734638 STDOUT 2074] | E
2019-03-18 11:10:02.734648 STDOUT 2074] | E
2019-03-18 11:10:02.734656 STDOUT 2074] | E           (caused by)
2019-03-18 11:10:02.734663 STDOUT 2074] | E           AttributeError: 'PSPNetResNet50' object has no attribute 'forward'

@crcrpar
Copy link
Contributor Author

crcrpar commented Mar 19, 2019

I apologize to have missed chainercv/experimental/links and I'm working on them.

@knorth55
Copy link
Contributor

can you also modify FCIS and Yolov2Tiny in experimental if possible?

@yuyu2172
Copy link
Member

Sorry. I had not checked this seriously.
Could you change chainercv.utils.testing.constant_stub_link.py?
Also, could you change all TrainChains in examples?

@yuyu2172
Copy link
Member

pfnCI, test this please

@pfn-ci-bot
Copy link
Collaborator

Successfully created a job for commit 45624ca:

@Hakuyume
Copy link
Member

Hakuyume commented Mar 20, 2019

How do you think of the following items that contain __call__?
*.rst files

The value(s) of variable(s) returned by :meth:`__call__`.
If an array is specified, :meth:`__call__` returns

https://github.com/chainer/chainercv/blame/45624ca3badfb3d530a9726375fa4ff9df7c5ced/examples/faster_rcnn/README.md#L16

@crcrpar
Copy link
Contributor Author

crcrpar commented Mar 20, 2019

I didn't change them because chainer.Link and chainer.Chain didn't include :meth:forward in their documentation.

However, I noticed that other Links like L.Convolution2D and Chains like ResNet50Layers included :meth:forward.

So, let me change them too.

@Hakuyume
Copy link
Member

@crcrpar
Copy link
Contributor Author

crcrpar commented Mar 22, 2019 via email

@Hakuyume
Copy link
Member

Since __call__ does not have its docstring and nothing is rendered, we should remove them.

@yuyu2172 yuyu2172 merged commit ed366d4 into chainer:master Mar 25, 2019
@yuyu2172
Copy link
Member

LGTM

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

Successfully merging this pull request may close these issues.

None yet

5 participants