Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

AttributeError: 'memoryview' object has no attribute 'size' #166

Open
magnoliacl opened this issue Aug 22, 2021 · 2 comments
Open

AttributeError: 'memoryview' object has no attribute 'size' #166

magnoliacl opened this issue Aug 22, 2021 · 2 comments

Comments

@magnoliacl
Copy link

When I run train.py python train.py --datacfg cfg/ape.data --modelcfg cfg/yolo-pose.cfg --initweightfile backup/ape/init.weights

i got this error AttributeError: 'memoryview' object has no attribute 'size'

@NishantTharani
Copy link

For you or anyone else getting a similar error and curious: this happened to me and the reason was that I was calling foo.data.size() on an object foo that was expected to be a PyTorch Tensor, but was actually a NumPy Array (the .data attribute of a numpy array apparently returns a memoryview object).

I wasn't using this library at all, but the advice is generic enough that it might still be useful to anyone searching for this error message

@rubbbish
Copy link

i got this error AttributeError: 'memoryview' object has no attribute 'size',too.How can I solve this problem?

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

No branches or pull requests

3 participants