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: module 'tensorflow.python.data.ops.dataset_ops' has no attribute 'DatasetV1' #624

Closed
ghost opened this issue Oct 18, 2019 · 5 comments
Labels
ty:bug type of the issue is a bug

Comments

@ghost
Copy link

ghost commented Oct 18, 2019

  • Weights and Biases version: 0.8.13
  • TensorFlow version: 2.0
  • Python version: 3.5
  • Operating System: Windows 10 Pro --- Version: 1903

Description

When submitting data for validation to "validation_data" or through "validation_split" in the class "tf.keras.Sequential" function "fit". It turns out an error. Without "wandb.keras.WandbCallback()" everything works fine. But also without "validation_data" or "validation_split" also works. I have to choose a validation or entry in "wandb".

What I Did

history = model.fit(
    X_train, y_train, batch_size=len(X_train), epochs=epochsNum, verbose=True, 
    callbacks=[wandb.keras.WandbCallback()], validation_data=(X_test, y_test), shuffle=True
    )

Terminal output

Traceback (most recent call last):
  File "PATH/Training_NN.py", line 171, in <module>
    callbacks=[wandb.keras.WandbCallback()], validation_data=(X_test, y_test), shuffle=True
  File "C:\Users\user\Anaconda3\envs\Main\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1363, in fit
    validation_steps=validation_steps)
  File "C:\Users\user\Anaconda3\envs\Main\lib\site-packages\wandb\keras\__init__.py", line 92, in new_arrays
    set_wandb_attrs(cbk, (val_inputs[0], val_targets[0]))
  File "C:\Users\user\Anaconda3\envs\Main\lib\site-packages\wandb\keras\__init__.py", line 70, in set_wandb_attrs
    elif is_dataset(val_data):
  File "C:\Users\user\Anaconda3\envs\Main\lib\site-packages\wandb\keras\__init__.py", line 32, in is_dataset
    return isinstance(data, (dataset_ops.DatasetV1, dataset_ops.DatasetV2))
AttributeError: module 'tensorflow.python.data.ops.dataset_ops' has no attribute 'DatasetV1'
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.89. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the ty:bug type of the issue is a bug label Oct 18, 2019
@vanpelt
Copy link
Contributor

vanpelt commented Oct 18, 2019

Hey @WaGGstoun, that's so strange we've been testing on the latest versions of tensorflow and didn't see this. I've created a branch that should address this issue. You can access try it now by running: pip install --upgrade git+git://github.com/wandb/client.git@feature/fix-tf2#egg=wandb. Let me know if that doesn't fix the issue for you. We'll target a new official release for early next week.

@ghost
Copy link
Author

ghost commented Oct 18, 2019

Hi @vanpelt, thank you for your prompt response. If I understand everything correctly. The error still remained, but changed from this:

File "C:\Users\user\Anaconda3\envs\Main\lib\site-packages\wandb\keras\__init__.py", line 32, in is_dataset
    return isinstance(data, (dataset_ops.DatasetV1, dataset_ops.DatasetV2))

, on this:

File "C:\Users\user\Anaconda3\envs\Main\lib\site-packages\wandb\keras\__init__.py", line 32, in is_dataset
    dataset_types = (dataset_ops.DatasetV2,)

Terminal output

Traceback (most recent call last):
  File "PATH/Training_NN.py", line 171, in <module>
    callbacks=[wandb.keras.WandbCallback()], validation_data=(X_test, y_test), shuffle=True
  File "C:\Users\user\Anaconda3\envs\Main\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1363, in fit
    validation_steps=validation_steps)
  File "C:\Users\user\Anaconda3\envs\Main\lib\site-packages\wandb\keras\__init__.py", line 95, in new_arrays
    set_wandb_attrs(cbk, (val_inputs[0], val_targets[0]))
  File "C:\Users\user\Anaconda3\envs\Main\lib\site-packages\wandb\keras\__init__.py", line 73, in set_wandb_attrs
    elif is_dataset(val_data):
  File "C:\Users\user\Anaconda3\envs\Main\lib\site-packages\wandb\keras\__init__.py", line 32, in is_dataset
    dataset_types = (dataset_ops.DatasetV2,)
AttributeError: module 'tensorflow.python.data.ops.dataset_ops' has no attribute 'DatasetV2'

@vanpelt
Copy link
Contributor

vanpelt commented Oct 19, 2019

Whoops, just pushed a new version that should fix this!

@ghost
Copy link
Author

ghost commented Oct 22, 2019

Thanks @vanpelt , everyone is working.

@ghost ghost closed this as completed Oct 22, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ty:bug type of the issue is a bug
Projects
None yet
Development

No branches or pull requests

1 participant