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

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

Open
Mayjig opened this issue Oct 6, 2023 · 0 comments
Open

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

Mayjig opened this issue Oct 6, 2023 · 0 comments

Comments

@Mayjig
Copy link

Mayjig commented Oct 6, 2023

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.

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

1 participant