You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pytorch Model deployment using Windows Powershell with hugging face to commit changes "RuntimeError: Could not infer dtype of numpy.uint8" error and "TypeError: ConnectionPool.init() got an unexpected keyword argument 'socket_options'"
#1198
change directory: Desktop\foodvisiondemo> cd foodvision_mini123
extract zip file ito this directory using command in format: Desktop\foodvisiondemo\space_name> Expand-Archive -Path "C:\Users\Pc\Downloads\foodvision_mini.zip" -DestinationPath "C:\Users\Pc\Desktop\foodvisiondemo\space_name"
initialize git in current working directory: git init
now run the following commands in sequence:
there will be 2 errors while building: "RuntimeError: Could not infer dtype of numpy.uint8" error and "TypeError: ConnectionPool.init() got an unexpected keyword argument 'socket_options'" To resolve these, change versions in requirement.txt by editing file in huggingface files and adding following:
gradio==2.6.4
numpy==1.24.4
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Following are the steps i followed that worked on May 5 2025:
download the archive from colab (foodvision_mini.zip)
create a folder on desktop (foodvisiondemo) using: "cd Desktop" followed by mkdir foodvisiondemo
go into this directory cd foodvisiondemo
create hugging face space and get its cloning link git clone https://huggingface.co/spaces/username/space_name
paste clonning link in terminal: C:\Users\Pc\Desktop\foodvisiondemo> git clone https://huggingface.co/spaces/username/space_name
change directory: Desktop\foodvisiondemo> cd foodvision_mini123
extract zip file ito this directory using command in format: Desktop\foodvisiondemo\space_name> Expand-Archive -Path "C:\Users\Pc\Downloads\foodvision_mini.zip" -DestinationPath "C:\Users\Pc\Desktop\foodvisiondemo\space_name"
initialize git in current working directory: git init
now run the following commands in sequence:
git remote -v
git lfs install
git lfs track "09_pretrained_effnetb2_feature_extractor_pizza_steak_sushi_20_percent.pth"
git lfs track ".pth"
git add .gitattributes
git config --global core.autocrlf false
git add *
git status
git commit -m "first commit"
git push
there will be 2 errors while building: "RuntimeError: Could not infer dtype of numpy.uint8" error and "TypeError: ConnectionPool.init() got an unexpected keyword argument 'socket_options'" To resolve these, change versions in requirement.txt by editing file in huggingface files and adding following:
gradio==2.6.4
numpy==1.24.4
Your Application will start running
Beta Was this translation helpful? Give feedback.
All reactions