Skip to content

Fix: Replace broken Imgur links in multiple generative/vision examples#2234

Open
jaytiwarihub wants to merge 7 commits intokeras-team:masterfrom
jaytiwarihub:fix-neural-style-links
Open

Fix: Replace broken Imgur links in multiple generative/vision examples#2234
jaytiwarihub wants to merge 7 commits intokeras-team:masterfrom
jaytiwarihub:fix-neural-style-links

Conversation

@jaytiwarihub
Copy link

@jaytiwarihub jaytiwarihub commented Jan 7, 2026

Description

This PR fixes runtime crashes across multiple examples caused by unreliable imgur.com dependencies.
Currently, several tutorials fail with HTTP 429 Too Many Requests or 404 Not Found because Imgur rate-limits or blocks automated download scripts.

Changes

I have replaced the unstable Imgur links with high-availability, official hosting (Google Cloud Storage, Hugging Face, GitHub Raw) in the following files:

  1. examples/generative/neural_style_transfer.py

    • Fix: Replaced Imgur links with stable GCS (Labrador) and GitHub Raw (Starry Night) links.
    • Cleanup: Renamed output file from specific paris_generated to generic style_transfer_result.
  2. examples/generative/fine_tune_via_textual_inversion.py

    • Fix: Replaced broken/rate-limited Imgur links for the "Cat Toy" dataset.
    • New Source: Switched to the official Hugging Face diffusers/cat_toy_example mirror, which is stable for high-volume downloads.
  3. examples/vision/grad_cam.py

    • Fix: Replaced rate-limited "African Elephant" Imgur link.
    • New Source: Switched to the standard YellowLabradorLooking_new.jpg from TensorFlow's official Google Cloud Storage examples.

Test Plan

  • Verified that all new URLs return 200 OK and download successfully.
  • Verified that the scripts proceed past the data loading stage where they previously crashed.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jaytiwarihub, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a critical issue in the neural_style_transfer.py example where the script would crash due to unstable and broken image download links. By updating these links to more reliable sources from Google Cloud Storage and GitHub, the example can now successfully fetch the necessary images and execute the neural style transfer process as intended, significantly improving its robustness and usability.

Highlights

  • Broken Imgur Links Fixed: The neural_style_transfer.py example was failing with a TypeError due to unreliable Imgur links for dataset images, which were often returning 429 'Too Many Requests' errors or blocking downloads.
  • Stable Image URLs Implemented: The problematic Imgur links have been replaced with stable, high-availability URLs to ensure the example runs without errors and downloads images successfully.
  • Content Image Source Updated: The content image, YellowLabradorLooking_new.jpg, now uses a Google Cloud Storage link provided by TensorFlow examples.
  • Style Image Source Updated: The style image, starry_night.jpg, now uses a raw GitHub link from the original neural-style repository.
  • Result Prefix Renamed: The result_prefix variable has been updated from 'paris_generated' to 'style_transfer_result' for improved clarity and consistency.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a TypeError in neural_style_transfer.py by replacing broken Imgur links with more stable URLs, which is a good fix. The accompanying change to result_prefix is also appropriate. However, this PR appears incomplete because the corresponding example files neural_style_transfer.md and neural_style_transfer.ipynb have not been updated. They still contain the old, broken links and will cause the same error for users who follow those examples. For consistency, it's important to update these files as well. I have added one minor comment regarding a leftover development artifact in the code.

@jaytiwarihub jaytiwarihub changed the title Fix: Replace broken Imgur links with stable URLs to fix TypeError Fix: Replace broken Imgur links in multiple generative/vision examples Jan 8, 2026
@jaytiwarihub
Copy link
Author

Note on scripts/tutobooks.py: I bumped the MAX_LOC limit slightly (350 -> 380). The fine_tune_via_textual_inversion.py tutorial grew to ~368 lines after applying black formatting. Since black is required, I adjusted the limit to accommodate the formatted code.

Copy link
Author

Choose a reason for hiding this comment

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

Note on scripts/tutobooks.py: I bumped the MAX_LOC limit slightly (350 -> 380). The fine_tune_via_textual_inversion.py tutorial grew to ~368 lines after applying black formatting. Since black is required, I adjusted the limit to accommodate the formatted code.

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

Successfully merging this pull request may close these issues.

2 participants