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

Added meaningful error if retrieving nil val from layer. Fixes #386 #442

Merged
merged 1 commit into from
Jul 1, 2016

Conversation

brollb
Copy link
Contributor

@brollb brollb commented Jul 1, 2016

WIP #386 Added googlenet-setters for testing error messages

@brollb
Copy link
Contributor Author

brollb commented Jul 1, 2016

This change makes it so it will throw an error if a value is accessed from a layer that is nil (and it will report the name of the value that was tried to access). This gives us better error messages as it throws a meaningful error before the could not call nil error that was there before.

Unfortunately, this doesn't check that the return value of the get is going to be called. This can be a problem because things like the following will also fail:

nn.Sequential().size = 10

WIP #386 Added googlenet-setters for testing error messages

WIP #386 Commented out tacking in extra values

WIP #386 Ignore "nil gets" if in "set" operation
@brollb brollb force-pushed the 386-better-errors-arch-import branch from e0747c9 to 3c63d00 Compare July 1, 2016 18:07
@brollb
Copy link
Contributor Author

brollb commented Jul 1, 2016

Just updated it so it will throw an error if any unsupported value is accessed in a "non-setting" way.

That is, the following will succeed:

model.imageSize = 256

but the following will fail:

nn.SpatialMaxPooling():ceil()

It is worth noting that print(model.imageSize) will fail if it hasn't been set in the file. This is the desired behavior bc I am assuming that accessed values should exist. If they do not exist in the nn mock, then it is an error if the script relies on using them.

@brollb brollb merged commit 3e33266 into master Jul 1, 2016
@brollb brollb deleted the 386-better-errors-arch-import branch July 1, 2016 18:14
@brollb brollb removed the in progress label Jul 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants