Closed Thire399 closed 1 year ago
This is a duplicate of Issue 52. I will close it here, please follow the solution presented there until we make a new release.
Looks like this a different hardware specific issue. So reopening it.
When getting the error AttributeError: 'str' object has no attribute 'decode'
, I was able to solve it by going to "carbontracker/components/gpu/nvidia.py"
and commenting out line 25 where it says devices = [name.decode("utf-8") for name in names]
, then adding devices = names
on a line before the return statement of that function. So the function should look like:
def devices(self):
"""Retrieves the name of all GPUs in a list.
Note:
Requires NVML to be initialized.
"""
names = [pynvml.nvmlDeviceGetName(handle) for handle in self._handles]
#devices = [name.decode("utf-8") for name in names]
devices = names
return devices
This issue has been addressed in Release v1.2.0. With Python 3.10's change in handling char*
from C extensions, the string decoding for NVIDIA GPU names via NVML has been adjusted accordingly. This ensures compatibility across different Python versions.
I am getting this odd bug while trying to use the carbon tracker with a pretrained pytorch model and my own pytroch model.
For reference: Ubuntu 20.04.5 LTS GPU: GTX1070 8GB