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

shallow complex model on Musicnet Dataset #10

Open
linglingxu opened this issue Oct 16, 2017 · 2 comments
Open

shallow complex model on Musicnet Dataset #10

linglingxu opened this issue Oct 16, 2017 · 2 comments

Comments

@linglingxu
Copy link

Hi all,
I got this error when trying to run the command: python train.py shallow_complex_model --in-memory --model=complex_shallow_convnet --complex --local-data data/musicnet_11khz.npz
2017-10-07 20-14-06
then i change
image
then i make a change that let "channels= 2", which is " channels=feature_dim[1]=1" before. Then i pass the previous question and get another error.
image

@OisinMoran
Copy link
Contributor

I have the same issue. Did you ever solve this @linglingxu?

@austinmw
Copy link

austinmw commented May 3, 2018

I'm getting the same thing and found that fan_in is equaling zero due to an input of (512,0,32) on line 236 of complexnn/init.py : fan_in, fan_out = initializers._compute_fans(tuple(self.kernel_size) + (self.input_dim, self.nb_filters)), where self.input_dim equals 0. This causes division by zero on line 71 of complexnn/init.

I think it stems from musicnet/musicnet/dataset.py lines 167 to 190:

        channels = 2 if self.complex_ else 1
        features_out = numpy.zeros(
            [features.shape[0], self.window_size, channels])
        if self.fourier:
            if self.complex_:
                data = fft(features, axis=1)
                features_out[:, :, 0] = numpy.real(data[:, :, 0])
                features_out[:, :, 1] = numpy.imag(data[:, :, 0])
            else:
                data = numpy.abs(fft(features, axis=1))
                features_out = data
        elif self.stft:
            _, _, data = stft(features, nperseg=120, noverlap=60, axis=1)
            length = data.shape[1]
            n_feats = data.shape[3]
            if self.complex_:
                features_out = numpy.zeros(
                    [len(self.train_data), length, n_feats * 2])
                features_out[:, :, :n_feats] = numpy.real(data)
                features_out[:, :, n_feats:] = numpy.imag(data)
            else:
                features_out = numpy.abs(data[:, :, 0, :])
        else:
            features_out = features
        return features_out, output

When I try to run shallow complex on the resampled musicnet dataset, first it sets channels=2 and features_out.shape=(22500,4096,2), but then it overwrites this to set features_out to equal features which is of shape (22500,4096,1). Channels is 1, but then it is later divided and floored by 2 to get input_dim, which then equals 0.

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