adriaciurana / DragGAN

Unofficial implementation of the DragGAN paper
MIT License
88 stars 15 forks source link

TypeError: 'type' object is not subscriptable #5

Closed adheep closed 1 year ago

adheep commented 1 year ago

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?

adriaciurana commented 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?

adheep commented 1 year ago

I am using Python 3.8.6 version

adriaciurana commented 1 year ago

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:

xunshengliuyin commented 1 year ago

from typing import Dict , Any,List, Not only dict