question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Numpy related error in NFP tutorial

See original GitHub issue

When following NFP’s homo prediction tutorial, recieved the following error

ValueError: Object arrays cannot be loaded when allow_pickle=False

When ran the following code

from chainer.datasets import split_dataset_random
from chainer_chemistry import datasets as D
from chainer_chemistry.dataset.preprocessors import preprocess_method_dict
from chainer_chemistry.datasets import NumpyTupleDataset

cache_dir = 'input/homo/'
dataset = NumpyTupleDataset.load(cache_dir + 'data.npz')

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
corochanncommented, Nov 13, 2019
  1. model = GraphConvPredictor(NFP(n_unit, n_unit, conv_layers), MLP(n_unit, 1)) is done in set_up_predictor method in the example.

https://github.com/pfnet-research/chainer-chemistry/blob/master/examples/qm9/train_qm9.py#L143-L144

So you can just replace this line to use your custom defined model above.

  1. Further, predict method and loss calculation is defined in Regressor class for regression task and Classifier class for classification task. So you need to “wrap” your model using Regressor or Classifier. Since it defines loss calculation and predict method, it can be used in both training and prediction.

Refer: https://github.com/pfnet-research/chainer-chemistry/blob/master/examples/qm9/train_qm9.py#L149-L150

0reactions
nshervtcommented, Dec 13, 2019

Thanks! I’ll check this soon and comment for closing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NumPy quickstart — NumPy v1.24 Manual
A frequent error consists in calling array with multiple arguments, ... When you print an array, NumPy displays it in a similar way...
Read more >
2022 How to Fix ImportError "No Module Named Numpy" Error ...
2022 How to Fix ImportError "No Module Named Numpy " Error in Python | Python Tutorial.
Read more >
Python numpy Error - arrays
The error is trying to tell you that two arrays are being used together where they should be the same size but they...
Read more >
How to use Python numpy.where() Method
In Python, we can use the numpy.where() function to select elements ... For example, condition can take the value of array([[True, True, ...
Read more >
NumPy arange(): How to Use np.arange()
Watch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found