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

AttributeError: type object 'tqdm' has no attribute 'notebook' #1452

Open
3 of 6 tasks
aitorme opened this issue Mar 23, 2023 · 3 comments
Open
3 of 6 tasks

AttributeError: type object 'tqdm' has no attribute 'notebook' #1452

aitorme opened this issue Mar 23, 2023 · 3 comments

Comments

@aitorme
Copy link

aitorme commented Mar 23, 2023

  • I have marked all applicable categories:
    • exception-raising bug
    • visual output bug
  • I have visited the source website, and in particular
    read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable:
    import tqdm, sys
    print(tqdm.__version__, sys.version, sys.platform)
4.65.0 3.8.2 (default, Dec 21 2020, 15:06:04) 
[Clang 12.0.0 (clang-1200.0.32.29)] darwin

I am loading the tqdm library but I cannot load the notebook anymore, when I try to do so with the following line:

for img_path in tqdm.notebook.tqdm(images):

I get the following error:

AttributeError: type object 'tqdm' has no attribute 'notebook'
@chandana5301
Copy link

import tqdm.notebook as tqdm
----> 4 tk0 = tqdm(train_dataloader, total=int(len(train_dataloader)))
5 for batch_idx,(data,target) in enumerate(tk0):
6 data,target=data.to(device),target.to(target)
TypeError: 'module' object is not callable

from tqdm import tqdm
tk0 = tqdm.notebook(train_dataloader, total=int(len(train_dataloader)))

AttributeError: type object 'tqdm' has no attribute 'notebook'

Why am i getting this error, i am using it for a scene recogition dataset

@Grufoony
Copy link

The standard way to import tqdm is

from tqdm import tqdm

and for the notebook version the correct import is

from tqdm.notebook import tqdm

@aitorme
Copy link
Author

aitorme commented Jun 6, 2023

dear @Grufoony,

Thanks for your answer. However, when importing the library method as tqdm.notebook.tqdm it should work in the same exact way as your import from tqdm.notebook import tqdm, so why isn't it working?

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

No branches or pull requests

3 participants