-
Notifications
You must be signed in to change notification settings - Fork 30
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
Errors #52
Comments
Looks like the energiservice api which we use to query the carbon emissions changed their string format. We will release a bug fix. For now, if you change the query method in energidataservice.py in your local installation it should work. You can find this in your installation here
|
The function |
This issue has been addressed in Release v1.2.0. We've phased out support for the |
When running carbon tracker like this:
tracker = CarbonTracker(epochs=100)
correct = 0
wrong = 0
tracker.epoch_start()
for i in range(100):
true_label = id2label[val_labels[i].item()]
img = T.ToPILImage()(val_features[i].squeeze())
inputs = processor(images=img, return_tensors="pt").to(device)
pixel_values = inputs.pixel_values
outputs = model(pixel_values)
logits = outputs.logits
logits.shape
prediction = logits.argmax(-1)
prediction_str = model.config.id2label[prediction.item()]
display(img)
print("Predicted class:", prediction_str)
print("True class:", true_label)
if true_label == prediction_str:
correct += 1
print("correct")
else:
wrong += 1
print("wrong")
tracker.epoch_end()
tracker.stop()
On an Intel(R) Core(TM) i9-10900KF CPU @ 3.70GHz with 16 GB RAM, NVIDIA GeForce GTX 980 Ti and Windows 10 in Jupyter Notebook, I get the following output from CarbonTracker:
CarbonTracker:
Actual consumption for 1 epoch(s):
Time: 0:00:05
Energy: 0.000152 kWh
CO2eq: 0.006405 g
This is equivalent to:
0.000060 km travelled by car
CarbonTracker: INFO - Traceback (most recent call last):
File "C:\Users\user\anaconda3\envs\gpu2\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\user\anaconda3\envs\gpu2\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\user\anaconda3\envs\gpu2\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\user\anaconda3\envs\gpu2\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\anaconda3\envs\gpu2\lib\site-packages\carbontracker\emissions\intensity\intensity.py", line 117, in carbon_intensity
carbon_intensity = fetcher.carbon_intensity(g_location, time_dur)
File "C:\Users\user\anaconda3\envs\gpu2\lib\site-packages\carbontracker\emissions\intensity\fetchers\energidataservice.py", line 21, in carbon_intensity
ci = self._emission_prognosis(time_dur=time_dur)
File "C:\Users\user\anaconda3\envs\gpu2\lib\site-packages\carbontracker\emissions\intensity\fetchers\energidataservice.py", line 48, in _emission_prognosis
raise exceptions.CarbonIntensityFetcherError(response.json())
File "C:\Users\user\anaconda3\envs\gpu2\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
CarbonTracker:
Predicted consumption for 100 epoch(s):
Time: 0:08:26
Energy: 0.015250 kWh
CO2eq: 1.462028 g
This is equivalent to:
0.013600 km travelled by car
CarbonTracker: Finished monitoring.
The text was updated successfully, but these errors were encountered: