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

jpwr compatibility with Python version <3.9 #1

Open
chelseajohn opened this issue Aug 21, 2024 · 0 comments
Open

jpwr compatibility with Python version <3.9 #1

chelseajohn opened this issue Aug 21, 2024 · 0 comments

Comments

@chelseajohn
Copy link
Collaborator

chelseajohn commented Aug 21, 2024

When using jpwr with python versions < 3.9

Traceback (most recent call last):
  File "/p/project1/jscbenchmark/john2/CARAML/resnet50/resnet50_benchmark_run/000000/000000_execute/work/benchmarks/scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py", line 73, in <module>
    app.run(main)  # Raises error on invalid flags, unlike tf.app.run()
  File "/usr/local/lib/python3.8/dist-packages/absl/app.py", line 308, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.8/dist-packages/absl/app.py", line 254, in _run_main
    sys.exit(main(argv))
  File "/p/project1/jscbenchmark/john2/CARAML/resnet50/resnet50_benchmark_run/000000/000000_execute/work/benchmarks/scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py", line 68, in main
    bench.run()
  File "/p/project1/jscbenchmark/john2/CARAML/resnet50/resnet50_benchmark_run/000000/000000_execute/work/benchmarks/scripts/tf_cnn_benchmarks/benchmark_cnn.py", line 1906, in run
    return self._benchmark_train()
  File "/p/project1/jscbenchmark/john2/CARAML/resnet50/resnet50_benchmark_run/000000/000000_execute/work/benchmarks/scripts/tf_cnn_benchmarks/benchmark_cnn.py", line 2111, in _benchmark_train
    return self._benchmark_graph(result_to_benchmark, eval_build_results)
  File "/p/project1/jscbenchmark/john2/CARAML/resnet50/resnet50_benchmark_run/000000/000000_execute/work/benchmarks/scripts/tf_cnn_benchmarks/benchmark_cnn.py", line 2316, in _benchmark_graph
    stats = self.benchmark_with_session(
  File "/p/project1/jscbenchmark/john2/CARAML/resnet50/resnet50_benchmark_run/000000/000000_execute/work/benchmarks/scripts/tf_cnn_benchmarks/benchmark_cnn.py", line 2430, in benchmark_with_session
    from jpwr.gpu.pynvml import power
  File "/p/project1/jscbenchmark/john2/CARAML/resnet50/nvidia_arm_tensorflow_packages/lib/python3.8/site-packages/jpwr/gpu/pynvml.py", line 6, in <module>
    class power(object):
  File "/p/project1/jscbenchmark/john2/CARAML/resnet50/nvidia_arm_tensorflow_packages/lib/python3.8/site-packages/jpwr/gpu/pynvml.py", line 7, in power
    def init(self, power_value_dict : dict[str,list[float]]):
TypeError: 'type' object is not subscriptable

Solution to make annotations compatible with Python <3.9
Include from __future__ import annotations line at the beginning of the file.

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