opentensor / bittensor

Internet-scale Neural Networks
https://www.bittensor.com/
MIT License
918 stars 318 forks source link

Logging Error #2393

Open decentai15 opened 2 weeks ago

decentai15 commented 2 weeks ago

Describe the bug

When logging raw weights (np array), it gives this error.

.../template/base/validator.py", line 240, in set_weights
    bt.logging.debug("raw_weights", raw_weights)

 File ".../python3.10/site-packages/bittensor/utils/btlogging/loggingmachine.py", line 436, in debug
    msg = _concat_message(msg, prefix, suffix)
  File ".../python3.10/site-packages/bittensor/utils/btlogging/loggingmachine.py", line 52, in _concat_message
    msg = f"{f'{prefix} - ' if prefix else ''}{msg}{f' - {suffix}' if suffix else ''}"
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

To Reproduce

Reproduce:

import bittensor as bt
import numpy as np

suffix = np.array([1, 2, 3, 4, 5])
prefix = "hey"

bt.logging.info(prefix, suffix)

Expected behavior

Expected: Log the data as string without any error

Screenshots

No response

Environment

Linux Ubuntu, Bittensor 8.2.0

Additional context

No response

thewhaleking commented 6 hours ago

Part of #2441