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

[Question] 'RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn' #1892

Closed
pkendrick opened this issue Oct 5, 2023 · 1 comment

Comments

@pkendrick
Copy link

I am encountering an issue where I am not sure of the source of the problem, in my optimisation problem I get the following error message after 10 trials (so it fails on the first GPEI step)

ing further trials. It will also help to convert integer or categorical parameters to float ranges where reasonable.
Original error: : RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

This is what my parameters look like (I am using float ranges and some fixed values):

[{'bounds': [0.0, 1.0],
  'name': 'unsmoothed_doa_confidence_threshold',
  'type': 'range'},
 {'bounds': [0.0, 1.0],
  'name': 'smoothed_doa_confidence_threshold',
  'type': 'range'},
 {'bounds': [-20.0, -0.01], 'name': 'exponential_constant', 'type': 'range'},
 {'name': 'smooth_gcc_method', 'type': 'fixed', 'value': 'weighted_mean'},
 {'bounds': [1e-06, 0.9], 'name': 'mask_threshold', 'type': 'range'},
 {'name': 'vnr_smoothing', 'type': 'fixed', 'value': False},
 {'bounds': [-20.0, 10.0], 'name': 'vnr_threshold', 'type': 'range'}]

The raw data of the objective looks as follows, which is clearly varying quite a lot according the input parameters, so it doesnt seem that it is that there is a good shape to the optimisation space. So I wondered if it was likely something else?

[{'mean_speech_only_gross_accuracy_per_frame': (0.5388631578947368,
                                                0.07211595929429725)},
 {'mean_speech_only_gross_accuracy_per_frame': (0.6135578947368421,
                                                0.07045896242452025)},
 {'mean_speech_only_gross_accuracy_per_frame': (0.5401263157894737,
                                                0.0718340082869864)},
 {'mean_speech_only_gross_accuracy_per_frame': (0.5866105263157894,
                                                0.06776191058526948)},
 {'mean_speech_only_gross_accuracy_per_frame': (0.5371789473684211,
                                                0.07234236752279831)},
 {'mean_speech_only_gross_accuracy_per_frame': (0.6142315789473685,
                                                0.07349812454475907)},
 {'mean_speech_only_gross_accuracy_per_frame': (0.5506526315789474,
                                                0.07373898748329656)},
 {'mean_speech_only_gross_accuracy_per_frame': (0.6111578947368421,
                                                0.07348657192746014)},
 {'mean_speech_only_gross_accuracy_per_frame': (0.21077894736842104,
                                                0.06700120114822074)},
 {'mean_speech_only_gross_accuracy_per_frame': (0.3936, 0.07713834904452109)}]

Any help debugging what this issue might be greatly appriciated!

@pkendrick
Copy link
Author

Note, I think actually there is something broken about my environment and it is pytorch issue not an ax one.

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

1 participant