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

float' object cannot be interpreted as an integer #21

Closed
Twinkle123321 opened this issue Dec 8, 2017 · 7 comments
Closed

float' object cannot be interpreted as an integer #21

Twinkle123321 opened this issue Dec 8, 2017 · 7 comments

Comments

@Twinkle123321
Copy link

Hi,when I run the code,it shows as following:
Loading data...
Generating images...
Traceback (most recent call last):
File "C:/Users/Guo/Desktop/EEGLearn-master/eeglearn/eeg_cnn_lib.py", line 473, in
av_feats = reduce(lambda x, y: x+y, [feats[:, i*192:(i+1)*192] for i in range(feats.shape[1] / 192)])
TypeError: 'float' object cannot be interpreted as an integer

so I modify the part of line 473 as" (feats.shape[1] //192)" ,it shows:
Loading data...
Generating images...
Traceback (most recent call last):
File "C:/Users/Guo/Desktop/EEGLearn-master/eeglearn/eeg_cnn_lib.py", line 477, in
32, normalize=False)
File "C:/Users/Guo/Desktop/EEGLearn-master/eeglearn/eeg_cnn_lib.py", line 67, in gen_images
for c in range(n_colors):
TypeError: 'float' object cannot be interpreted as an integer

would you give me some suggestions?thank you

@pbashivan
Copy link
Owner

What data are you trying to load? Is it the sample_data or another dataset?

@Twinkle123321
Copy link
Author

wow,thank you to answer my question,I'm trying to load the sample_data
should code be supported by GPU?

@pbashivan
Copy link
Owner

Code should be runnable on GPU.
I can't recreated the error on my end. What's the shape of feats?

@Twinkle123321
Copy link
Author

sorry,when I update the version of Keras,it could run successful,thank you!
I want to ask another very simple math question of code:
def azim_proj(pos):
[r, elev, az] = cart2sph(pos[0], pos[1], pos[2])
return pol2cart(az, m.pi / 2 - elev)
function pol2cart(theta,rho) 's second param should be radius,but "m.pi / 2 - elev" is a angle,how it works?

@pbashivan
Copy link
Owner

pbashivan commented Dec 26, 2017

We actually ignore r because we assume that all points are located on a sphere. Azimuthal equidistance projection keeps retains the distance between points on the sphere to a fixed point (e.g. north pole on earth map) while projecting down to 2D. So pi/2 - elevation is the true measure of distance between the fixed point and every other point. This is the conceptual reason why pi/2 - elevation is used as r. Some math related to this is discussed in here

@Twinkle123321
Copy link
Author

OK,thank you very much

@wangyue663
Copy link

Because the author uses 2.7 python and you use 3.5 python, you have to change'' to'\'

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

3 participants