Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

[BUG] The example of continous wavelet transformation (CWT) does not work on my laptop #424

Closed
shevateng0 opened this issue Oct 4, 2021 · 1 comment · Fixed by #425
Closed
Assignees
Labels
bug Something isn't working

Comments

@shevateng0
Copy link
Contributor

I would like to try the example of CWT with ricker wavelet, but some error is reported. The code is listed below which is exactly the same as in https://docs.rapids.ai/api/cusignal/stable/api.html#wavelets.

import cusignal
import cupy as cp
import matplotlib.pyplot as plt
t = cp.linspace(-1, 1, 200, endpoint=False)
sig  = cp.cos(2 * cp.pi * 7 * t) + cusignal.gausspulse(t - 0.4, fc=2)
widths = cp.arange(1, 31)
cwtmatr = cusignal.cwt(sig, cusignal.ricker, widths)
plt.imshow(cp.asnumpy(cwtmatr), extent=[-1, 1, 31, 1], cmap='PRGn',
               aspect='auto', vmax=abs(cwtmatr).max(),
               vmin=-abs(cwtmatr).max())
plt.show()

The reported error is listed below.

Traceback (most recent call last):
  File "cupytest.py", line 19, in <module>
    cwtmatr = cusignal.cwt(sig, cusignal.ricker, widths)
  File "/home/xinux/miniconda3/lib/python3.8/site-packages/cusignal/wavelets/wavelets.py", line 310, in cwt
    wavelet_data = wavelet(min(10 * width, len(data)), width)
  File "/home/xinux/miniconda3/lib/python3.8/site-packages/cusignal/wavelets/wavelets.py", line 175, in ricker
    return _ricker_kernel(a, size=points)
  File "cupy/_core/_kernel.pyx", line 784, in cupy._core._kernel.ElementwiseKernel.__call__
TypeError: 'cupy._core.core.ndarray' object cannot be interpreted as an integer

Since no error appeared when I tried the example of spectrogram, I believe the installation of cuda, cupy and cusignal is successful. Please kindly help me resolve this issue. Thanks.

Some info are listed below in case you need.

  • My laptop is HP Pavilion gaming laptop with graphics card GTX1650.
  • Use Python3.8 and cuda11.2.
  • Both cupy and cusignal are installed via conda. The commands are listed below:
conda install -c rapidsai -c nvidia -c conda-forge \
    cusignal=21.08 python=3.8 cudatoolkit=11.2 
conda install -c conda-forge cupy
@shevateng0 shevateng0 added ? - Needs Triage Need team to review and classify question Further information is requested labels Oct 4, 2021
@awthomp awthomp self-assigned this Oct 5, 2021
@awthomp awthomp added bug Something isn't working and removed question Further information is requested ? - Needs Triage Need team to review and classify labels Oct 5, 2021
@awthomp
Copy link
Member

awthomp commented Oct 5, 2021

Hi @shevateng0 -- I've confirmed this is a valid bug (I get the same error on my local machine), and we'll prioritize getting it fixed! Thanks for using cusignal and submitting the issue.

@awthomp awthomp changed the title [QST] The example of continous wavelet transformation (CWT) does not work on my laptop [BUG] The example of continous wavelet transformation (CWT) does not work on my laptop Oct 5, 2021
@rapids-bot rapids-bot bot closed this as completed in #425 Oct 6, 2021
rapids-bot bot pushed a commit that referenced this issue Oct 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants