qywu / TextGAIL

MIT License
28 stars 15 forks source link

Type error #3

Open yone456 opened 2 years ago

yone456 commented 2 years ago

Hello, I am a student in Japan. Your research is very interesting. I actually tried to run your prepared code in googlecolab, but I got the following error Is there any solution for this?

!python main.py --config /config/config.yaml task.name=CommonGEN

Traceback (most recent call last): File "main.py", line 9, in from torchfly.training import TrainerLoop File "/content/TextGAIL/TorchFly/torchfly/training/init.py", line 2, in from .flymodel import FlyModel File "/content/TextGAIL/TorchFly/torchfly/training/flymodel.py", line 9, in from torchfly.metrics import CategoricalAccuracy, Average, MovingAverage, Speed File "/content/TextGAIL/TorchFly/torchfly/metrics/init.py", line 6, in from .moving_average import MovingAverage File "/content/TextGAIL/TorchFly/torchfly/metrics/moving_average.py", line 12, in class MovingAverage(Metric): File "/content/TextGAIL/TorchFly/torchfly/metrics/moving_average.py", line 43, in MovingAverage def get_metric(self, reset: bool = False): File "/usr/local/lib/python3.7/dist-packages/overrides/overrides.py", line 88, in overrides return _overrides(method, check_signature, check_at_runtime) File "/usr/local/lib/python3.7/dist-packages/overrides/overrides.py", line 114, in _overrides _validate_method(method, super_class, check_signature) File "/usr/local/lib/python3.7/dist-packages/overrides/overrides.py", line 135, in _validate_method ensure_signature_is_compatible(super_method, method, is_static) File "/usr/local/lib/python3.7/dist-packages/overrides/signature.py", line 93, in ensure_signature_is_compatible ensure_return_type_compatibility(super_type_hints, sub_type_hints, method_name) File "/usr/local/lib/python3.7/dist-packages/overrides/signature.py", line 288, in ensure_return_type_compatibility f"{method_name}: return type {sub_return} is not a {super_return}." TypeError: MovingAverage.get_metric: return type None is not a typing.Union[float, typing.Tuple[float, ...], typing.Dict[str, float], typing.Dict[str, typing.List[float]]].

qywu commented 2 years ago

It seems that some packages might be incompatible. Maybe try to use a lower version of Python or a lower version of overrides.

yone456 commented 2 years ago

Thanks for the advice. The error was resolved by lowering the version of overrides to 4.0.0. There were several other errors that were encountered but were resolved.

Errors related to gdown pip install --upgrade --no-cache-dir gdown

Errors related to omegaconf pip install omegaconf==2.0.6

yone456 commented 2 years ago

After training TextGAIL, we ran Generation.ipynb. However, it returned the following error.

ImportError: cannot import name 'FlyModule' from 'torchfly.trainig'

Is there any solution for this?

CUMTGG commented 2 years ago

a good work!!!!

xxSpencer commented 2 years ago

Dear author, May I know the version of package hydra

xxSpencer commented 2 years ago

@qywu

xiang-xiang-zhu commented 1 year ago

Hello

Traceback (most recent call last):
  File "main.py", line 36, in <module>
    main()
  File "main.py", line 22, in main
    config = FlyConfig.load()
  File "/home/hx/github项目/TorchFly/torchfly/flyconfig/flyconfig.py", line 189, in load
    config.runtime.owd = os.getcwd()
AttributeError: 'NoneType' object has no attribute 'owd'

environment: omegaconf ==2.0.6 overrides ==4.0.0 TorchFly==0.0.1

How can I solve it