Closed adheep closed 1 year ago
I think that maybe is the python version. If I remember correct, previous version than 3.7 needs typing.Dict
in contrast to dict
. Which python version are you using?
I am using Python 3.8.6
version
Sorry, the problem is not that it is 3.6.
Starting with 3.6, typing was introduced, but it wasn't until 3.9 that typing.Dict was replaced by dict. I'm using 3.9.
There are several ways to fix the problem:
from __future__ import annotations
to the first line of the file.typing.Dict
and replace dict
with Dict
.from typing import Dict , Any,List, Not only dict
Getting this error when trying to run 'python gradio_app.py'
Traceback (most recent call last): File "gradio_app.py", line 11, in
from drag_gan.drag_gan import DragGAN
File "D:\Projects\Python\DragGAN\drag_gan\drag_gan.py", line 77, in
class DragGAN:
File "D:\Projects\Python\DragGAN\drag_gan\drag_gan.py", line 93, in DragGAN
def params(self) -> dict[str, Any]:
TypeError: 'type' object is not subscriptable
any idea how you can fix it?