kr-colab / diploSHIC

feature-based deep learning for the identification of selective sweeps
MIT License
50 stars 14 forks source link

Empty output in predict mode #25

Closed hkchi closed 4 years ago

hkchi commented 4 years ago

Hi,

Thanks for developing this useful tool and the detailed instructions coming with it.

I was testing diploSHIC using the Anopheles example, on a multicore machine using Intel E5-2683 v4 Broadwell CPU, with python 3.7.6, tensorflow 2.1.0, keras 2.3.1 and pandas 1.0.1 from conda. By applying the proposed changes in #23 and #24, I was able to beat all the errors all the way down. However, the output file in predict mode was empty though it was generated. This can be fixed by changing outputFile.close to outputFile.close() at: https://github.com/kern-lab/diploSHIC/blob/7d55417af438e321c374dadc2f7e58f56107443e/diploSHIC.py#L319 Strangely, when model_from_json and the following prediction using the model were suppressed (no tensorflow invoked), contents from outputFile.write() was visible in the output file without fixing the close() method.

Kaichi

andrewkern commented 4 years ago

hi there-- we are yet to update diploSHIC to be compatible with tensorflow 2+ as there have been major changes to the tf package. I'd recommend trying with tf 1.15 or similar.

hkchi commented 4 years ago

Thanks for the reminder. I tried both tensorflow 1.14.0 and tensorflow-gpu 1.14.0 with python 3.6.9, and they worked well without changing outputFile.close.

andrewkern commented 4 years ago

great! so if you are set i'll close this issue. feel free to reopen it if you are still having issues.