platypus icon indicating copy to clipboard operation
platypus copied to clipboard

Bug - error during transforming raw prediction into bounding boxes

Open kimhs950627 opened this issue 3 years ago • 1 comments

Describe the bug I ran the example (BCCD) on Kaggle, and my personal laptop. And I got this error: nm must be NULL or a character vector the same length as x

when I ran the following code: test_boxes<-get_boxes(test_preds, anchors=blood_anchors, labels=blood_labels)

To Reproduce Code and steps to reproduce the behavior:

Below is my entire code. library(platypus) origin_dir<-here::here() BCCD_dir<-file.path(origin_dir, 'BCCD') annot_dir=file.path(BCCD_dir, 'Annotations') img_dir=file.path(BCCD_dir, 'JPEGImages')

blood_labels=c('Platelets', 'RBC', 'WBC') blood_anchors=generate_anchors(anchors_per_grid = 3, annot_path = annot_dir, labels=blood_labels) net_h=416 net_w=416 n_class=length(blood_labels)

test_yolo<-yolo3(net_h = net_h, net_w=net_w, n_class=length(blood_labels), anchors=blood_anchors) test_yolo test_yolo %>% load_model_weights_hdf5(file.path(origin_dir, 'BCCD-yolov3-platypus.h5')) test_image<-list.files(img_dir, full.names = T)[1] #I picked the first image test_img<-image_load(test_image, target_size = c(net_w, net_h)) %>% image_to_array() %>% array_reshape(dim=c(1,net_w, net_h, 3)) test_img=test_img/255 test_preds<-test_yolo %>% predict(test_img) test_boxes<-get_boxes(test_preds, anchors=blood_anchors, labels=blood_labels)

and the following is my session info Session info ----------------------------------- setting value
version R version 4.0.3 (2020-10-10) os Windows 10 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate Korean_Korea.949
ctype Korean_Korea.949
tz Asia/Seoul
date 2021-05-28

  • Packages --------------------------------------- package * version date lib abind 1.4-5 2016-07-21 [1] assertthat 0.2.1 2019-03-21 [1] backports 1.2.0 2020-11-02 [1] base64enc 0.1-3 2015-07-28 [1] broom 0.7.2 2020-10-20 [1] callr 3.5.1 2020-10-13 [1] cellranger 1.1.0 2016-07-27 [1] cli 2.5.0 2021-04-26 [1] colorspace 2.0-1 2021-05-04 [1] crayon 1.4.1 2021-02-08 [1] curl 4.3 2019-12-02 [1] DBI 1.1.0 2019-12-15 [1] dbplyr 2.0.0 2020-11-03 [1] digest 0.6.27 2020-10-24 [1] dplyr * 1.0.6 2021-05-05 [1] ellipsis 0.3.2 2021-04-29 [1] fansi 0.4.2 2021-01-15 [1] farver 2.1.0 2021-02-28 [1] forcats * 0.5.0 2020-03-01 [1] fs 1.5.0 2020-07-31 [1] generics 0.1.0 2020-10-31 [1] ggplot2 * 3.3.3 2020-12-30 [1] glue 1.4.2 2020-08-27 [1] gridExtra 2.3 2017-09-09 [1] gtable 0.3.0 2019-03-25 [1] haven 2.3.1 2020-06-01 [1] here 1.0.1 2020-12-13 [1] hms 1.1.0 2021-05-17 [1] httr 1.4.2 2020-07-20 [1] jsonlite 1.7.2 2020-12-09 [1] keras * 2.4.0 2021-03-29 [1] labeling 0.4.2 2020-10-20 [1] lattice 0.20-41 2020-04-02 [2] lifecycle 1.0.0 2021-02-15 [1] lubridate 1.7.9.2 2020-11-13 [1] magick * 2.7.2 2021-05-02 [1] magrittr 2.0.1 2020-11-17 [1] Matrix 1.2-18 2019-11-27 [2] modelr 0.1.8 2020-05-19 [1] munsell 0.5.0 2018-06-12 [1] pillar 1.6.1 2021-05-16 [1] pkgbuild 1.2.0 2020-12-15 [1] pkgconfig 2.0.3 2019-09-22 [1] platypus * 0.1.1 2021-02-26 [1] png 0.1-7 2013-12-03 [1] prettyunits 1.1.1 2020-01-24 [1] processx 3.5.2 2021-04-30 [1] progress 1.2.2 2019-05-16 [1] ps 1.6.0 2021-02-28 [1] purrr * 0.3.4 2020-04-17 [1] R6 2.5.0 2020-10-28 [1] rappdirs 0.3.3 2021-01-31 [1] RColorBrewer 1.1-2 2014-12-07 [1] Rcpp 1.0.6 2021-01-15 [1] readr * 1.4.0 2020-10-05 [1] readxl 1.3.1 2019-03-13 [1] remotes 2.2.0 2020-07-21 [1] reprex 0.3.0 2019-05-16 [1] reticulate 1.20 2021-05-03 [1] rlang 0.4.11 2021-04-30 [1] rprojroot 2.0.2 2020-11-15 [1] rstudioapi 0.13 2020-11-12 [1] rvest 0.3.6 2020-07-25 [1] scales 1.1.1 2020-05-11 [1] sessioninfo 1.1.1 2018-11-05 [1] stringi 1.5.3 2020-09-09 [1] stringr * 1.4.0 2019-02-10 [1] tensorflow * 2.4.0 2021-03-23 [1] tfruns 1.5.0 2021-02-26 [1] tibble * 3.1.1 2021-04-18 [1] tidyr * 1.1.2 2020-08-27 [1] tidyselect 1.1.1 2021-04-30 [1] tidyverse * 1.3.0 2019-11-21 [1] tinytex 0.27 2020-11-01 [1] utf8 1.2.1 2021-03-12 [1] vctrs 0.3.8 2021-04-29 [1] whisker 0.4 2019-08-28 [1] withr 2.4.2 2021-04-18 [1] xfun 0.19 2020-10-30 [1] XML 3.99-0.6 2021-03-16 [1] xml2 1.3.2 2020-04-23 [1] zeallot 0.1.0 2018-01-28 [1] source
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.5)
    CRAN (R 4.0.5)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.4)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    Github (maju116/platypus@080e3d3) CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.5)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.5)
    CRAN (R 4.0.3)
    CRAN (R 4.0.3)

[1] C:/Users/Owner/Documents/R/win-library/4.0 [2] C:/Program Files/R/R-4.0.3/library

kimhs950627 avatar May 28 '21 06:05 kimhs950627

Pretty sure this is the root cause. No objects were detected. It’s been assigned as a bug. https://github.com/maju116/platypus/issues/94

wolfpack12 avatar Jun 29 '22 23:06 wolfpack12