the-full-stack / fsdl-text-recognizer-2022

Source of the FSDL 2022 labs, which are at https://github.com/full-stack-deep-learning/fsdl-text-recognizer-2022-labs
https://fullstackdeeplearning.com/course
MIT License
81 stars 26 forks source link

avoid crash in Colab due to gradio importlib magic #42

Closed charlesfrye closed 2 years ago

charlesfrye commented 2 years ago

something weird happens when you import gradio -- it appears to be tracking its dependencies, and if you change when/where it gets imported or what components are used, it will sometimes break if the dependencies have changed since the kernel started.

this is a weird bug and im being cagey and vague about it because there's a related very weird fact, which is that gradio has itself as one of its members (!), so the following code runs:

import gradio

assert gradio.gradio == gradio
charlesfrye commented 2 years ago

Resolved by resetting pkg_resources