Closed Running-z closed 5 years ago
@Running-z That is you due to updates in pytorch. You can either downgrade your pytorch to 0.3 version and keep using code from master branch, or you can checkout develop branch. Let me know if that works for you.
@Mariewelt I tried to replace the pytorch0.3 environment, then run jak2_demo, and finally I got an unexpected error in "train_model", The errors obtained are as follows:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-27-9d34a040fb80> in <module>()
10
11 ### Transfer learning
---> 12 RL.transfer_learning(transfer_data, n_epochs=n_transfer)
13 _, prediction = estimate_and_update(n_to_generate)
14 prediction_log.append(prediction)
/deepchem/code/ReLeaSE_0.3.0/reinforcement.py in transfer_learning(self, data, n_epochs, augment)
131
132 def transfer_learning(self, data, n_epochs, augment=False):
--> 133 _ = self.generator.fit(data, n_epochs, augment=augment)
/deepchem/code/ReLeaSE_0.3.0/stackRNN.py in fit(self, data, n_epochs, all_losses, print_every, plot_every, augment)
329
330 for epoch in range(1, n_epochs + 1):
--> 331 inp, target = data.random_training_set(smiles_augmentation)
332 loss = self.train_step(inp, target)
333 loss_avg += loss
/deepchem/code/ReLeaSE_0.3.0/data.py in random_training_set(self, smiles_augmentation)
87
88 def random_training_set(self, smiles_augmentation):
---> 89 chunk = self.random_chunk()
90 if smiles_augmentation is not None:
91 chunk = '<' + smiles_augmentation.randomize_smiles(chunk[1:-1]) + '>'
/deepchem/code/ReLeaSE_0.3.0/data.py in random_chunk(self)
67 random_smiles (str).
68 """
---> 69 index = random.randint(0, self.file_len-1)
70 return self.file[index]
71
/miniconda/lib/python3.6/random.py in randint(self, a, b)
219 """
220
--> 221 return self.randrange(a, b+1)
222
223 def _randbelow(self, n, int=int, maxsize=1<<BPF, type=type,
/miniconda/lib/python3.6/random.py in randrange(self, start, stop, step, _int)
197 return istart + self._randbelow(width)
198 if step == 1:
--> 199 raise ValueError("empty range for randrange() (%d,%d, %d)" % (istart, istop, width))
200
201 # Non-unit step argument supplied.
ValueError: empty range for randrange() (0,0, 0)
Can this give some explanation?
@Running-z
It looks to me like your transfer pool is empty. You can make sure it's empty by printing it out:
print(transfer_data.file)
You transfer pool is empty, because all the probabilities returned by your predictive model are less than threshold, so there is nothing to put in the transfer pool.
There are several things you can try to avoid this:
Make sure your threshold is not to high (start from 0.1 or 0.05)
Make sure your predictive model is accurate. Look at the cv_metrics variable
Try generating more compounds before launching the training
Manually add compounds to transfer_data
Simply skip the transfer learning step
I tried to run your JAK2-demo using my jak2 data, but when I execute to "train_model" here, I get an unexpected error
Execute the code in the following section to report an error:
Get the following error:
I didn't encounter any mistakes before this step, but this step got an unexpected error. Can you give me some guidance?