Numpy related error in NFP tutorial
See original GitHub issueWhen 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:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
model = GraphConvPredictor(NFP(n_unit, n_unit, conv_layers), MLP(n_unit, 1))
is done inset_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.
predict
method and loss calculation is defined inRegressor
class for regression task andClassifier
class for classification task. So you need to “wrap” your model usingRegressor
orClassifier
. Since it defines loss calculation andpredict
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
Thanks! I’ll check this soon and comment for closing the issue.