tsai icon indicating copy to clipboard operation
tsai copied to clipboard

Breaking change in fastai/fastcore breaks tsai 0.4.0

Open petli opened this issue 8 months ago • 4 comments
trafficstars

tsai has a dependency on fastai>=2.7.18, but the very recently released 2.8 includes a breaking change (https://github.com/AnswerDotAI/fastcore/pull/669) in fastcore:

>>> import tsai.imports
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\peter.liljenberg\code\ai\payrolldata\AI-SLL\tst\Lib\site-packages\tsai\imports.py", line 57, in <module>
    from fastcore.dispatch import *
  File "C:\Users\peter.liljenberg\code\ai\payrolldata\AI-SLL\tst\Lib\site-packages\fastcore\dispatch.py", line 2, in __getattr__
    raise ImportError(
ImportError: Could not import '__path__' from fastcore.dispatch - this module has been moved to the fasttransform package.
To migrate your code, please see the migration guide at: https://answerdotai.github.io/fasttransform/fastcore_migration_guide.html

Ideally this breaking change should've been in a new major version, but that would still broken here since the >= version specifier would've been satisfied by a 3.0 version too. This can be handled short-term here in tsai by changing the dependency to fastai~=2.7.18 to avoid pulling in 2.8 or anything later until the code is updated to the new package structure.

A workaround is to manually downgrade fastai and fastcore after installing tsai (or in my case, synthcity which depends on this):

pip install fastcore==1.7.29 fastai==2.7.19

petli avatar Mar 18 '25 12:03 petli

For compatibility with fastai>=2.8.0 you might want to look at this migration guide we wrote.

If you have any questions I'd be happy to help as I contributed quite a bit to this change.

RensDimmendaal avatar Mar 18 '25 14:03 RensDimmendaal

In tsai/imports.py, there's from fastcore.dispatch import *.

I encountered this issue in version 0.3.9 as well.

Thanks for the downgrade tip!

davidsarosi92 avatar Mar 18 '25 14:03 davidsarosi92

I think it's closable: https://github.com/KI-AIM/Cinnamon/pull/169

davidsarosi92 avatar Mar 31 '25 07:03 davidsarosi92

Thanks for this! I still had to use:

fastcore==1.7.29 
fastai==2.7.19

to ensure that tsai.imports worked.

ajay-bhargava avatar Jun 14 '25 13:06 ajay-bhargava

This issue has been fixed in tsai==0.4.1

oguiza avatar Jul 30 '25 06:07 oguiza

I still can't get this to work. If i downgrade it's complaning that it need pytorch<2.7. If I install latest fastai==2.8.5 the errror persists. Any suggestions without the downgrade?

igorrendulic avatar Oct 30 '25 16:10 igorrendulic

这是来自QQ邮箱的假期自动回复邮件。您的邮件已收到,谢谢!

mPowc avatar Oct 30 '25 16:10 mPowc