Closed chengstark closed 1 year ago
Are you using the latest version (master branch or the latest PyPI version, which currently is 0.0.25)?
You were using a dummy (empty) preprocessor. Now I'd like to raise a warning for such use cases when calling
from_config
.
I installed the package with pip just now, python is 3.7.13, torch-ecg is 0.0.25. I ran the package with a real signal, it still produced this error.
I see. There are actually 2 types of PreProcessor
s. One is from torch_ecg._preprocessors
, whose signature is (sig:numpy.ndarray, fs:int) -> Tuple[numpy.ndarray, int]
; the other is from torch_ecg.preprocessors
with signature (sig: torch.Tensor) -> torch.Tensor
.
Thank you for replying, I am currently using from torch_ecg.preprocessors import PreprocManager
, should I use the other one?
Thank you for replying, I am currently using from
torch_ecg.preprocessors import PreprocManager
, should I use the other one?
It depends on whether you do the preprocessings before or after transforming the data from numpy arrays to torch tensors. Usually, I would do it in some Dataset
class before this transformation. But I am not sure whether my data processing pipeline could be further optimized.
I see, please correct me if I misunderstood. If I use the preprocessing manager (torch_ecg.preprocessors import PreprocManager)
in the Dataset class it won't generate this " forward() takes 2 positional arguments but 3 were given " error?
Which should I use if I just want to test it out on a single signal (numpy array) beforehand?
If you just want to try something on numpy arrays, please use torch_ecg._preprocessors.PreprocManager
.
torch_ecg._preprocessors.PreprocManager
takes numpy arrays as input, with an additional fs
parameter.
torch_ecg.preprocessors.PreprocManager
takes only one torch tensor as input.
Problem solved. Thank you so much!
Hello, I encountered this error: