freeCodeCamp: Machine Learning with Python Projects - HTTP 403 from CDN

Describe your problem and how to reproduce it: There seem to be issue with loading dataset from the cdn.freecodecamp.org when using get_file() function. The problem occurs only when both these conditions are fulfilled - using that function and when data is supposed to be downloaded from cdn.freecodecamp.org. So this currently applies only to Cat and Dog Image Classifier and Linear Regression Health Costs Calculator notebooks.

There’s no issue when dataset is downloaded alternatively - using wget as in Book Recommendation Engine using KNN notebook, or when dataset is not on cdn.freecodecamp.org as in Neural Network SMS Text Classifier.

When replacing downloading get_file() with the wget alternative in the affected notebooks datasets downloads fine.

fcc_cat_dog.ipynb

Downloading data from https://cdn.freecodecamp.org/project-data/cats-and-dogs/cats_and_dogs.zip
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/data_utils.py in get_file(fname, origin, untar, md5_hash, file_hash, cache_subdir, hash_algorithm, extract, archive_format, cache_dir)
    262       try:
--> 263         urlretrieve(origin, fpath, dl_progress)
    264       except HTTPError as e:

8 frames
HTTPError: HTTP Error 403: Forbidden

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/data_utils.py in get_file(fname, origin, untar, md5_hash, file_hash, cache_subdir, hash_algorithm, extract, archive_format, cache_dir)
    263         urlretrieve(origin, fpath, dl_progress)
    264       except HTTPError as e:
--> 265         raise Exception(error_msg.format(origin, e.code, e.msg))
    266       except URLError as e:
    267         raise Exception(error_msg.format(origin, e.errno, e.reason))

Exception: URL fetch failure on https://cdn.freecodecamp.org/project-data/cats-and-dogs/cats_and_dogs.zip: 403 -- Forbidden

fcc_predict_health_costs_with_regression.ipynb

Downloading data from https://cdn.freecodecamp.org/project-data/health-costs/insurance.csv
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/data_utils.py in get_file(fname, origin, untar, md5_hash, file_hash, cache_subdir, hash_algorithm, extract, archive_format, cache_dir)
    262       try:
--> 263         urlretrieve(origin, fpath, dl_progress)
    264       except HTTPError as e:

8 frames
HTTPError: HTTP Error 403: Forbidden

During handling of the above exception, another exception occurred:

Exception                                 Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/data_utils.py in get_file(fname, origin, untar, md5_hash, file_hash, cache_subdir, hash_algorithm, extract, archive_format, cache_dir)
    263         urlretrieve(origin, fpath, dl_progress)
    264       except HTTPError as e:
--> 265         raise Exception(error_msg.format(origin, e.code, e.msg))
    266       except URLError as e:
    267         raise Exception(error_msg.format(origin, e.errno, e.reason))

Exception: URL fetch failure on https://cdn.freecodecamp.org/project-data/health-costs/insurance.csv: 403 -- Forbidden

Add a Link to the page with the problem: https://www.freecodecamp.dev/learn/machine-learning-with-python/machine-learning-with-python-projects/cat-and-dog-image-classifier https://colab.research.google.com/drive/1UCHiRuBLxo0S3aMuiDXlaP54LsxzrXHz https://www.freecodecamp.dev/learn/machine-learning-with-python/machine-learning-with-python-projects/linear-regression-health-costs-calculator https://colab.research.google.com/drive/1o8sTSCMa8Tnmcqhp_2BKKJEaHFoFmRzI?usp=sharing

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (13 by maintainers)

Most upvoted comments