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

[train] fix tensorflow example by using ScalingConfig #46565

Merged
merged 3 commits into from
Jul 14, 2024
Merged

[train] fix tensorflow example by using ScalingConfig #46565

merged 3 commits into from
Jul 14, 2024

Conversation

mjovanovic9999
Copy link
Contributor

@mjovanovic9999 mjovanovic9999 commented Jul 11, 2024

Why are these changes needed?

I was trying to run the basic example https://github.com/ray-project/ray/blob/master/python/ray/train/examples/tf/tune_tensorflow_autoencoder_example.py

Gave me this error:

ValueError: scaling_config should be an instance of ScalingConfig, found <class 'dict'> with value {'num_workers': 2, 'use_gpu': False}.

This chage soloved the issue:

scaling_config = dict(num_workers=num_workers, use_gpu=use_gpu)

to:

from ray.train import ScalingConfig
...
scaling_config = ScalingConfig(num_workers=num_workers, use_gpu=use_gpu)

Related issue number

Closes #46505

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@mjovanovic9999
Copy link
Contributor Author

@anyscalesam Please review

@mjovanovic9999 mjovanovic9999 marked this pull request as ready for review July 11, 2024 12:03
Copy link
Contributor

@matthewdeng matthewdeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you run the formatting step?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewdeng matthewdeng changed the title soloved ScalingConfig issue [train] fix tensorflow example by using ScalingConfig Jul 14, 2024
@matthewdeng matthewdeng enabled auto-merge (squash) July 14, 2024 19:55
Copy link
Contributor

@matthewdeng matthewdeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Jul 14, 2024
@matthewdeng matthewdeng merged commit 4e75921 into ray-project:master Jul 14, 2024
7 checks passed
@anyscalesam anyscalesam added @external-author-action-required Alternate tag for PRs where the author doesn't have labeling permission. train Ray Train Related Issue labels Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@external-author-action-required Alternate tag for PRs where the author doesn't have labeling permission. go add ONLY when ready to merge, run all tests train Ray Train Related Issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in example tune_tensorflow_autoencoder_example.py
3 participants