pix-plot icon indicating copy to clipboard operation
pix-plot copied to clipboard

Fix issue with use_cache

Open ed-fish opened this issue 3 years ago • 3 comments

Fixes issue where vector list cannot be cast to np array when loaded sequentially from cache.

Adds support for using both 2d and 1d cached vectors by expanding 1d vectors and stacking to ensure the correct shape.

ed-fish avatar Oct 02 '21 10:10 ed-fish

That's interesting @ed-fish were you getting 2d arrays written to disk before? Everything should be 1d in the pipeline...

If you can say more about what led you to want to make this change, that would be helpful!

duhaime avatar Oct 02 '21 12:10 duhaime

Oh yes you are correct! On second look I realised I created this error by using a dir with a mix of 1 and 2 dimensional vectors. Perhaps it is better addressed using an assert to ensure that if you use outputs from another model that they are 1d. Please feel free to reject the PR.

ed-fish avatar Oct 02 '21 12:10 ed-fish

@ed-fish thanks for your follow up. An assertion that prints a useful message upon failure (e.g. Image vectors should be 1D but the image vectors found are 2D) would be a welcome PR instead if you like!

duhaime avatar Oct 02 '21 13:10 duhaime