-
Notifications
You must be signed in to change notification settings - Fork 71
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
Maximum recursion level reached on input_process #5
Comments
Hi @ideznaby ,
|
Hi @Ubikas thank you for your answer, I tried this but I am still getting the same error, were you able to run the code on Physionet data? Thanks |
Hi @ideznaby , as far as I remember I was getting the same error with physionet data, but I adopted algorithm to my dataset and it has 19 attributes instead of 35. In my opinion to use json is not the best idea, I'd rather use numpy array with strict ts type order like [sample, ts_type, ts_length, attribute]. So in this case would be [2000,5,49,35]. Unfortunately I didn't have time to code it and as json format worked fine for me I left it as it was. |
Instead of using usjon, just use python's original json API as follows in data_loader.py and input_process.py files: # import ujson as json
import json
class NpEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, np.integer):
return int(obj)
elif isinstance(obj, np.floating):
return float(obj)
elif isinstance(obj, np.ndarray):
return obj.tolist()
else:
return super(NpEncoder, self).default(obj) rec = json.dumps(rec, cls=NpEncoder) This effectively mitigated Maximum recursion level reached error in my code. |
Thank you for your suggestions. It solved the problem of maximum recursion level issues. Btw have you got exact paper claimed results? |
No, because PyTorch itself is non-deterministic. Please check: https://pytorch.org/docs/stable/notes/randomness.html |
I am getting this error when I run input_process.py on physionet data, the error is happening on this line:
rec = json.dumps(rec)
do you have any solution for this?
Thanks
The text was updated successfully, but these errors were encountered: