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

New error both on colab and in my conda environment #258

Closed
tonyco82 opened this issue Apr 8, 2023 · 5 comments · Fixed by #261
Closed

New error both on colab and in my conda environment #258

tonyco82 opened this issue Apr 8, 2023 · 5 comments · Fixed by #261

Comments

@tonyco82
Copy link

tonyco82 commented Apr 8, 2023

ImportError: cannot import name 'Schema' from 'pydantic'

@tonyco82 tonyco82 changed the title New error in colab New error both on colab and in my conda environment Apr 8, 2023
@Lordmau5
Copy link
Collaborator

Lordmau5 commented Apr 8, 2023

Yep, getting the same on 3.1.1 and 3.1.0

Traceback (most recent call last):
  File "c:\program files\python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\program files\python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "E:\Development\so-vits-svc-4.0\__env\Scripts\svc.exe\__main__.py", line 7, in <module>
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\so_vits_svc_fork\__main__.py", line 113, in train
    from .train import train
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\so_vits_svc_fork\train.py", line 9, in <module>
    import lightning.pytorch as pl
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\lightning\__init__.py", line 18, in <module>
    from lightning.app import storage  # noqa: E402
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\lightning\app\__init__.py", line 24, in <module>
    from lightning.app import components  # noqa: E402, F401
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\lightning\app\components\__init__.py", line 1, in <module>
    from lightning.app.components.database.client import DatabaseClient
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\lightning\app\components\database\__init__.py", line 1, in <module>
    from lightning.app.components.database.client import DatabaseClient
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\lightning\app\components\database\client.py", line 22, in <module>
    from lightning.app.components.database.utilities import _GeneralModel
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\lightning\app\components\database\utilities.py", line 20, in <module>
    from fastapi import Response, status
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\fastapi\__init__.py", line 5, in <module>
    from .applications import FastAPI
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\fastapi\applications.py", line 3, in <module>
    from fastapi import routing
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\fastapi\routing.py", line 6, in <module>
    from fastapi import params
  File "E:\Development\so-vits-svc-4.0\__env\lib\site-packages\fastapi\params.py", line 4, in <module>
    from pydantic import Schema
ImportError: cannot import name 'Schema' from 'pydantic' (E:\Development\so-vits-svc-4.0\__env\lib\site-packages\pydantic\__init__.cp310-win_amd64.pyd)

As per this issue, installing 0.88.0 of fastapi (fastapi==0.88.0) makes it work again
Lightning-AI/pytorch-lightning#17106 (comment)

@34j
Copy link
Collaborator

34j commented Apr 9, 2023

29c8cc0

@tony-rsrv
Copy link

tony-rsrv commented Apr 9, 2023

I've changed the fastapi to 0.88.0 and now I'm getting this error:

  File "/usr/local/bin/svc", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/so_vits_svc_fork/__main__.py", line 129, in train
    train(
  File "/usr/local/lib/python3.9/dist-packages/so_vits_svc_fork/train.py", line 80, in train
    trainer.fit(model, datamodule=datamodule)
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/trainer/trainer.py", line 520, in fit
    call._call_and_handle_interrupt(
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/trainer/call.py", line 44, in _call_and_handle_interrupt
    return trainer_fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/trainer/trainer.py", line 559, in _fit_impl
    self._run(model, ckpt_path=ckpt_path)
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/trainer/trainer.py", line 935, in _run
    results = self._run_stage()
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/trainer/trainer.py", line 976, in _run_stage
    self._run_sanity_check()
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/trainer/trainer.py", line 1005, in _run_sanity_check
    val_loop.run()
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/loops/utilities.py", line 177, in _decorator
    return loop_run(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/loops/evaluation_loop.py", line 108, in run
    batch, batch_idx, dataloader_idx = next(data_fetcher)
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/loops/fetchers.py", line 136, in __next__
    self._fetch_next_batch(self.dataloader_iter)
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/loops/fetchers.py", line 150, in _fetch_next_batch
    batch = next(iterator)
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/utilities/combined_loader.py", line 276, in __next__
    out = next(self._iterator)
  File "/usr/local/lib/python3.9/dist-packages/lightning/pytorch/utilities/combined_loader.py", line 122, in __next__
    out = next(self.iterators[self._iterator_idx])
  File "/usr/local/lib/python3.9/dist-packages/torch/utils/data/dataloader.py", line 681, in __next__
    data = self._next_data()
  File "/usr/local/lib/python3.9/dist-packages/torch/utils/data/dataloader.py", line 721, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/usr/local/lib/python3.9/dist-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/usr/local/lib/python3.9/dist-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/usr/local/lib/python3.9/dist-packages/so_vits_svc_fork/dataset.py", line 31, in __getitem__
    data = torch.load(self.datapaths[index], weights_only=True, map_location="cpu")
  File "/usr/local/lib/python3.9/dist-packages/torch/serialization.py", line 712, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "/usr/local/lib/python3.9/dist-packages/torch/serialization.py", line 1047, in _load
    unpickler = UnpicklerWrapper(data_file, **pickle_load_args)
TypeError: __init__() got an unexpected keyword argument 'weights_only'```

34j added a commit that referenced this issue Apr 9, 2023
@34j 34j closed this as completed in #261 Apr 9, 2023
@34j
Copy link
Collaborator

34j commented Apr 20, 2023

@allcontributors add tonyco82 bug

@allcontributors
Copy link
Contributor

@34j

I've put up a pull request to add @tonyco82! 🎉

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

Successfully merging a pull request may close this issue.

4 participants