aspuru-guzik-group/ORGANIC

When I ran, met a valueerror about data shape

Opened this issue · 0 comments

Mayjig commented

0%| | 0/1 [00:01<?, ?it/s]


ValueError Traceback (most recent call last)
Cell In[4], line 5
3 model.set_training_program(['logP'], [5])
4 model.load_metrics()
----> 5 model.train()

File /home2/bej22/projects/druglikeness/new/ORGANIC/model/organic.py:902, in ORGANIC.train(self, ckpt_dir)
899 if not self.PRETRAINED and not self.SESS_LOADED:
901 self.sess.run(tf.global_variables_initializer())
--> 902 self.pretrain()
904 if not os.path.exists(ckpt_dir):
905 os.makedirs(ckpt_dir)

File /home2/bej22/projects/druglikeness/new/ORGANIC/model/organic.py:865, in ORGANIC.pretrain(self)
859 dis_x_train, dis_y_train = self.dis_loader.load_train_data(
860 self.positive_samples, negative_samples)
861 dis_batches = self.dis_loader.batch_iter(
862 zip(dis_x_train, dis_y_train), self.DIS_BATCH_SIZE,
863 self.PRETRAIN_DIS_EPOCHS)
--> 865 for batch in dis_batches:
866 x_batch, y_batch = zip(*batch)
867 feed = {
868 self.discriminator.input_x: x_batch,
869 self.discriminator.input_y: y_batch,
870 self.discriminator.dropout_keep_prob: self.DIS_DROPOUT
871 }

File /home2/bej22/projects/druglikeness/new/ORGANIC/model/data_loaders.py:105, in Dis_Dataloader.batch_iter(self, data, batch_size, num_epochs)
101 def batch_iter(self, data, batch_size, num_epochs):
102 """
103 Generates a batch iterator for a dataset.
104 """
--> 105 data = np.array(list(data))
106 data_size = len(data)
107 num_batches_per_epoch = int(len(data) / batch_size) + 1

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (2885, 2) + inhomogeneous part.