We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I faced a error when adding commit/reveal weights to subnet Finally i found that weights must be a list of int, though weights should be a float list sum to 1 as before. This function: https://github.com/opentensor/bittensor/blob/master/bittensor/utils/weight_utils.py#L372
Run Validator on this PR SocialTensor/SocialTensorSubnet#75
/home/ubuntu/miniconda3/envs/main/lib/python3.10/site-packages/bittensor/utils/weight_utils.py:3 │ │ 88 in │ │ │ │ 385 │ │ │ 386 │ vec_values = Vec(data=None, sub_type="U16") │ │ 387 │ vec_values.value = [ │ │ ❱ 388 │ │ U16(ScaleBytes(value.to_bytes(2, "little"))) for value in values │ │ 389 │ ] │ │ 390 │ values = ScaleBytes(vec_values.encode().data) AttributeError: 'float' object has no attribute 'to_bytes'
No response
Linux Ubuntu
The text was updated successfully, but these errors were encountered:
Hello @toilaluan, Can you use weight_utils.convert_weights_and_uids_for_emit to normalize the weights? This should convert them to int cc: @opendansor
weight_utils.convert_weights_and_uids_for_emit
Sorry, something went wrong.
@ibraheem-opentensor thanks, i gonna try it
No branches or pull requests
Describe the bug
I faced a error when adding commit/reveal weights to subnet
Finally i found that weights must be a list of int, though weights should be a float list sum to 1 as before.
This function: https://github.com/opentensor/bittensor/blob/master/bittensor/utils/weight_utils.py#L372
To Reproduce
Run Validator on this PR SocialTensor/SocialTensorSubnet#75
Expected behavior
/home/ubuntu/miniconda3/envs/main/lib/python3.10/site-packages/bittensor/utils/weight_utils.py:3 │
│ 88 in │
│ │
│ 385 │ │
│ 386 │ vec_values = Vec(data=None, sub_type="U16") │
│ 387 │ vec_values.value = [ │
│ ❱ 388 │ │ U16(ScaleBytes(value.to_bytes(2, "little"))) for value in values │
│ 389 │ ] │
│ 390 │ values = ScaleBytes(vec_values.encode().data)
AttributeError: 'float' object has no attribute 'to_bytes'
Screenshots
No response
Environment
Linux Ubuntu
Additional context
No response
The text was updated successfully, but these errors were encountered: