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

AttributeError: 'numpy.ndarray' object has no attribute 'atom_features' #3759

Open
mukherjeesutanu opened this issue Jan 1, 2024 · 1 comment

Comments

@mukherjeesutanu
Copy link

❓ Questions & Help

Hi! I am new to deepchem and I am trying to build a classification model based on HIV.csv dataset. But during the fitting of the model I got the following error: AttributeError: 'numpy.ndarray' object has no attribute 'atom_features'. The corresponding code is given below:

import deepchem as dc
import pandas as pd
import os
df = pd.read_csv("HIV.csv")

smiles = df["smiles"][:100]

labels = df["HIV_active"][:100]

import deepchem as dc

featurizer = dc.feat.CircularFingerprint()

loader = dc.data.InMemoryLoader(tasks=["task1"], featurizer=featurizer)

dataset = loader.create_dataset(zip(smiles, labels), shard_size=2)

len(dataset)

from deepchem.splits.splitters import RandomSplitter
split_dataset = RandomSplitter()

train_data,valid_data,test_data=split_dataset.train_valid_test_split(dataset, frac_train= 0.8, frac_valid= 0.1, frac_test= 0.1, seed=23)

transformer = dc.trans.BalancingTransformer(dataset=dataset)
dataset = transformer.transform(dataset)

model = dc.models.GraphConvModel(n_tasks=1, mode='classification', graph_conv_layers=[128,128], dropout=0.20)

model.fit(train_data, nb_epoch=100)

@arunppsg
Copy link
Contributor

arunppsg commented Jan 2, 2024

For GraphConvModel, I think ConvMolFeaturizer should be used instead of CircularFingerprint. Could you retry the same with ConvMolFeaturizer?

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

No branches or pull requests

2 participants