GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix the dataset loading when in the code directory. · NoriVicJr/DeepLearningTutorials@8a9a83d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • code
    • logistic_sgd.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎code/logistic_sgd.py‎

Copy file name to clipboardExpand all lines: code/logistic_sgd.py
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,12 @@ def load_data(dataset):
159159
data_dir, data_file = os.path.split(dataset)
160160
if data_dir == "" and not os.path.isfile(dataset):
161161
# Check if dataset is in the data directory.
162-
new_path = os.path.join(os.path.split(os.path.split(__file__)[0])[0],
163-
"data", dataset)
162+
new_path = os.path.split(__file__)
163+
if new_path[0] == "":
164+
new_path = os.path.join('..', "data", dataset)
165+
else:
166+
new_path = os.path.join(os.path.split(os.path.split(__file__)[0])[0],
167+
"data", dataset)
164168
if os.path.isfile(new_path) or data_file == 'mnist.pkl.gz':
165169
dataset = new_path
166170

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.