from bioimageio.spec import load_description
from bioimageio.spec._package import get_resource_package_content
BIOIMAGEIO_WEIGHTS_PRIORITY = ["torchscript", "pytorch_state_dict", "tensorflow_saved_model_bundle"]
model = 'affable-shark'
rd = load_description(model, perform_io_checks=False)
package_content = get_resource_package_content(rd)
, the rdf expectedly is fetched, and the get_resource_package_content retrieves all the content, including all the available weights format. But the content is not downloaded. They can be retrieved with the download() function provided by spec.
, but if we use the weights priority argument:
from bioimageio.spec import load_description
from bioimageio.spec._package import get_resource_package_content
BIOIMAGEIO_WEIGHTS_PRIORITY = ["torchscript", "pytorch_state_dict", "tensorflow_saved_model_bundle"]
model = 'affable-shark'
rd = load_description(model, perform_io_checks=False)
package_content = get_resource_package_content(rd, weights_priority_order=BIOIMAGEIO_WEIGHTS_PRIORITY)
All the weights are downloaded, and the get_resource_package_content returns only the first available weight provided by BIOIMAGEIO_WEIGHTS_PRIORITY.
I am not sure how we want to utilize the priority feature, but I think the weights shouldn't be downloaded, and the get_resource_package_content should retrieve only the contents with no other side action :)
totally! thanks for sharing this bug. I'll make sure that weights_priority_order does not change the behavior to download despite perform_io_checks=False
Hey hey!
Having this:
, the rdf expectedly is fetched, and the
get_resource_package_content
retrieves all the content, including all the available weights format. But the content is not downloaded. They can be retrieved with thedownload()
function provided by spec., but if we use the weights priority argument:
All the weights are downloaded, and the
get_resource_package_content
returns only the first available weight provided byBIOIMAGEIO_WEIGHTS_PRIORITY
.I am not sure how we want to utilize the priority feature, but I think the weights shouldn't be downloaded, and the
get_resource_package_content
should retrieve only the contents with no other side action :)