gpt-3.5-turbo-0125· openai
Suzhen/CodeChat
AttributeError Traceback (most recent call last) <ipython-input-9-4ffb7fb209e1> in <cell…
- User
AttributeError Traceback (most recent call last) in <cell line: 6>() 4 5 # Загружаем набор данных “cats_vs_dogs” ----> 6 dataset, info = tfds.load('cats_vs_dogs', with_info=True) 7 8 # Печатаем информацию о наборе данных
AttributeError: module 'tensorflow_datasets' has no attribute 'load'
- Assistant
This error occurs because the
loadfunction is not directly available in thetensorflow_datasetsmodule. Instead, you can use theloadfunction from thetensorflow_datasetsnamespace.Here is how you can modify your code to load the
cats_vs_dogsdataset using the correct syntax:import tensorflow_datasets as tfds # Загружаем набор данных “cats_vs_dogs” dataset, info = tfds.load('cats_vs_dogs', with_info=True) # Печатаем информацию о наборе данных print(info)By importing
tensorflow_datasetsastfdsand using the correct syntax, you should be able to load the dataset without any errors.