Prediction of bandgap

Dear Dr. Bharath,
I am a newbie to Deepchem. I run a small code as following in Colab in order to calculate bandgap

!pip install pymatgen~=2020.12
!pip install matminer==0.6.5
!pip install dgl
import deepchem as dc
import numpy as np
import pymatgen as mg
import os
os.environ[‘DEEPCHEM_DATA_DIR’] = os.getcwd()
tasks, datasets, transformers = dc.molnet.load_bandgap()
train_dataset, valid_dataset, test_dataset = datasets
train_dataset, val_dataset, test_dataset = datasets
n_tasks = len(tasks)
n_features = train_dataset.get_data_shape()[0]
model = dc.models.MultitaskRegressor(n_tasks, n_features,batch_size=32, learning_rate=0.001), nb_epoch=10)
metric = dc.metrics.Metric(dc.metrics.mean_squared_error)
print(“Training set score:”, model.evaluate(train_dataset, [metric], transformers))
print(“Test set score:”, model.evaluate(test_dataset, [metric], transformers))

But I got
ValueError: Input contains NaN, infinity or a value too large for dtype(‘float32’).

Would you please help me to solve it? And after that how about the code to predict a bandgap for a new compound?

Best regards,


Hey, can you try using the latest version of matminer? !pip install --upgrade matminer