301 Moved Permanently recieved when running load_models.sh
farnaznouraei opened this issue · comments
Hi!
Firstly, one of the files you are trying to load using load_models.sh, has been renamed:
hand_landmark_3d.tflite >> hand_landmark.tflite
This itself took me a few hours to figure out and modify the bash script so I can run this command without getting a 404 error message.
Secondly, I am not able to load the two other files, which are from metalwhale/hand_tracking repo. When I just ran the original load_models.sh commands for this repo, I get a Error 404 Not Found. Then I changed the raw file address according to what I get when I right-click on the Download button in metalwhale/hand_tracking/models/palm_detection_without_custom_op.tflite . Therefore what I do is I change:
wget --header 'Host: raw.githubusercontent.com' --user-agent 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'Accept-Language: en-US,en;q=0.5' --referer 'https://github.com/metalwhale/hand_tracking/blob/master/palm_detection_without_custom_op.tflite' --header 'Upgrade-Insecure-Requests: 1' 'https://raw.githubusercontent.com/metalwhale/hand_tracking/master/palm_detection_without_custom_op.tflite' --output-document './models/palm_detection.tflite'
to:
wget --header 'Host: raw.githubusercontent.com' --user-agent 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'Accept-Language: en-US,en;q=0.5' --referer 'https://github.com/metalwhale/hand_tracking/blob/master/palm_detection_without_custom_op.tflite' --header 'Upgrade-Insecure-Requests: 1' 'https://github.com/metalwhale/hand_tracking/raw/master/models/palm_detection_without_custom_op.tflite' --output-document './models/palm_detection.tflite'
And now the error has changed to the following:
--2020-08-26 18:58:50-- https://github.com/metalwhale/hand_tracking/raw/master/models/palm_detection_without_custom_op.tflite
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/metalwhale/hand_tracking/raw/master/models/palm_detection_without_custom_op.tflite [following]
--2020-08-26 18:58:50-- https://github.com/metalwhale/hand_tracking/raw/master/models/palm_detection_without_custom_op.tflite
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 301 Moved Permanently
.
.
.
Location: https://github.com/metalwhale/hand_tracking/raw/master/models/palm_detection_without_custom_op.tflite [following]
20 redirections exceeded.
Could you please help me with this? Not sure why these redirections happen and why they're unsuccessful.
Thanks!!
Okay.... It turns out the problem was again a changed directory path :-/
I changed the URLs back to how they were and just added the folder name /models/
to the path for palm detection. So the file load_models.bash contents now look like:
wget --no-check-certificate --header 'Host: raw.githubusercontent.com' --user-agent 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'Accept-Language: en-US,en;q=0.5' --referer 'raw.githubusercontent.com/google/mediapipe/master/mediapipe/models/hand_landmark.tflite' --header 'Upgrade-Insecure-Requests: 1' 'raw.githubusercontent.com/google/mediapipe/master/mediapipe/models/**hand_landmark.tflite**' --output-document './models/hand_landmark.tflite'
wget --no-check-certificate --header 'Host: raw.githubusercontent.com' --user-agent 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:71.0) Gecko/20100101 Firefox/71.0' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header 'Accept-Language: en-US,en;q=0.5' --referer '**raw.githubusercontent.com**/metalwhale/hand_tracking/master/**models**/palm_detection_without_custom_op.tflite' --header 'Upgrade-Insecure-Requests: 1' '**raw.githubusercontent.com**/metalwhale/hand_tracking/master/**models**/palm_detection_without_custom_op.tflite' --max-redirect=100 --output-document './models/palm_detection.tflite'
BTW I also changed the --referer
argument into the raw file url rather than the repo url as it used to be.
and now it downloads the files smoothly... Please modify the path names in line with the changes in the used repositories so others don't waste time on it! Thank you.
@farnaznouraei could you make a small pull request?
@farnaznouraei could you make a small pull request?
Sure, will do that soon.