-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[v1.x] Tool to help update/restore onnx support #19876
base: v1.x
Are you sure you want to change the base?
Conversation
Hey @Zha0q1 , Thanks for submitting the PR
CI supported jobs: [windows-cpu, website, clang, centos-cpu, windows-gpu, centos-gpu, edge, unix-gpu, unix-cpu, miscellaneous, sanity] Note: |
# Detect MXNet | ||
print('Detected MXNet version: %s' % mxnet.__version__) | ||
mx_path = os.path.abspath(mxnet.__file__) | ||
mx_path = mx_path[:mx_path.rfind('/')] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to use os.path.join(mx_path, "..", "contrib", "onnx"), so this will work in windows as well.
logging.error('ONNX backup path not found. %s does not exist' % backup_path) | ||
|
||
# Restore backup | ||
os.chdir(onnx_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this to work on windows, could you just check if the backup path exists and move it back then? The find/cp/rm commands won't work under windows.
As we frequently improve our ONNX support, users might want to get timely access to the latest changes. However, MXNet releases might not happen as frequent as the users would want and they might have other compatibility concerns to update the entire mxnet module. To help with this, this pr adds a simple tool to update(replace) and restore the
mxnet/contrib/onnx
folder to the latest version on github. For example, a user that has mxnet 1.7 installed can use this script to get the latest onnx support without updating mxnet to a later version. This script helps make our onnx support more accessible and users can report bugs back and expect them fixed more easily.The script will automatically find the currently installed mxnet. The original files will be backuped to
mxnet/contrib/onnx/backup
.--branch
option controls which mxnet branch to checkout and if--restore
option is specified then files inbackup
will be restored.To update to changes in v1.x
To update to changes in a specific branch
To restore the original files