Skip to content

When I run, I met a valueerror about data shape #31

@Mayjig

Description

@Mayjig

I ran the example code, got error like this:

ValueError Traceback (most recent call last)
Cell In[2], line 5
3 model.set_training_program(['novelty'], [1])
4 model.load_metrics()
----> 5 model.train(ckpt_dir='ckpt')

File /home2/bej22/projects/druglikeness/new/ORGAN/organ/init.py:750, in ORGAN.train(self, ckpt_dir)
747 if not self.PRETRAINED and not self.SESS_LOADED:
749 self.sess.run(tf.global_variables_initializer())
--> 750 self.pretrain()
752 if not os.path.exists(ckpt_dir):
753 os.makedirs(ckpt_dir)

File /home2/bej22/projects/druglikeness/new/ORGAN/organ/init.py:696, in ORGAN.pretrain(self)
686 #print(dis_batches)
687 #print(dis_x_train)
688 #print(dis_y_train)
(...)
693 #print(np.hstack((dis_x_train,dis_y_train)).shape)
694 # print(np.array(list(zip(dis_x_train, dis_y_train))).shape)
695 supervised_d_losses = []
--> 696 for batch in dis_batches:
697 print(batch.shape)
698 x_batch, y_batch = zip(*batch)

File /home2/bej22/projects/druglikeness/new/ORGAN/organ/data_loaders.py:89, in Dis_Dataloader.batch_iter(self, data, batch_size, num_epochs)
85 def batch_iter(self, data, batch_size, num_epochs):
86 """
87 Generates a batch iterator for a dataset.
88 """
---> 89 data = np.array(list(data))
90 data_size = len(data)
91 print(data_size)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions