Annotation data import error
noorye4 opened this issue · comments
I download the dataset .
when I exec "python3 cross_vali_data_convert_merge.py" I got some error:
annotation_file_name= ../old_version/Dataset/annotation_bed_170308_1405_01.csv
Traceback (most recent call last):
File "cross_vali_data_convert_merge.py", line 107, in
x, y = dataimport(filepath1, filepath2)
File "cross_vali_data_convert_merge.py", line 44, in dataimport
y = np.zeros(((len(tmp2) + 1 - 2 * window_size)/slide_size+1,8))
TypeError: 'float' object cannot be interpreted as an integer
I try fix that ,convert float to int
y = np.zeros(((len(tmp2) + 1 - 2 * window_size)/slide_size+1,8))
to
y = np.zeros((int((len(tmp2) + 1 - 2 * window_size)/slide_size+1),8))
and I got this error
annotation_file_name= ../old_version/Dataset/annotation_bed_170308_1405_01.csv
Traceback (most recent call last):
File "cross_vali_data_convert_merge.py", line 107, in
x, y = dataimport(filepath1, filepath2)
File "cross_vali_data_convert_merge.py", line 89, in dataimport
y[k/slide_size,:] = np.array([2,0,0,0,0,0,0,0])
IndexError: only integers, slices (:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices
Hi, this issue was same in issue#1.
I updated this source code a couple minutes ago. Would you try it again using latest code?
I try the lastest code. I use python3
It's still has problem like
annotation_file_name= ../old_version/Dataset/annotation_bed_170308_1405_01.csv
Traceback (most recent call last):
File "cross_vali_data_convert_merge.py", line 107, in
x, y = dataimport(filepath1, filepath2)
File "cross_vali_data_convert_merge.py", line 89, in dataimport
y[k/slide_size,:] = np.array([2,0,0,0,0,0,0,0])
IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices
I use python2.7 to run the code. It's ok no error.
I think the problem is python2 and python3 use different 3rd library and version maybe.
Thank you reply