GIoULoss doesn't go below 1 · Issue #982 · tensorflow/addons
文章推薦指數: 80 %
... prediction problem # where we can use GIoU as our loss function. x1 = int(row)-int(rad) y1 = int(col)-int(rad) x2 = int(row)+int(rad) y2 ... Skiptocontent {{message}} tensorflow / addons Public Notifications Fork 589 Star 1.6k Code Issues 208 Pullrequests 39 Actions Projects 2 Security Insights More Code Issues Pullrequests Actions Projects Security Insights Newissue Haveaquestionaboutthisproject?SignupforafreeGitHubaccounttoopenanissueandcontactitsmaintainersandthecommunity. Pickausername EmailAddress Password SignupforGitHub Byclicking“SignupforGitHub”,youagreetoourtermsofserviceand privacystatement.We’lloccasionallysendyouaccountrelatedemails. AlreadyonGitHub? Signin toyouraccount Jumptobottom GIoULossdoesn'tgobelow1 #982 Closed nimish1512openedthisissue Jan31,2020 ·5comments Closed GIoULossdoesn'tgobelow1 #982 nimish1512openedthisissue Jan31,2020 ·5comments Labels losses Comments Copylink nimish1512 commented Jan31,2020 • edited Systeminformation OSPlatformandDistribution(e.g.,LinuxUbuntu16.04):Ubuntu18.04LTS TensorFlowversionandhowitwasinstalled(sourceorbinary):2.1.0(binary) TensorFlow-Addonsversionandhowitwasinstalled(sourceorbinary):0.7.1(binary) Pythonversion:3.6.9 IsGPUused?(yes/no):yes Describethebug IamusingtheGIoULosstotrainasmallCNNusingkeraswhichpredictsthe(x,y)ofaboundingbox.Thetrainingstartswithlossat1.04andstopsdecreasingafter1.0.Itriedchangingthearchitectureandepochsbutitgetsstuckatval_loss=1.0 Codetoreproducetheissue defPreprocessLabels(row,col,rad): #Convert(row,col)&radiusto(x1,y1)&(x2,y2) #Thishelpsustoshapetheproblemasboundingboxpredictionproblem #wherewecanuseGIoUasourlossfunction. x1=int(row)-int(rad) y1=int(col)-int(rad) x2=int(row)+int(rad) y2=int(col)+int(rad) return[y1,x1,y2,x2] defDataGenerator(FileList,mode='train'): DataInput,DataLabels=[],[] forimg_nameinFileList: img=cv2.imread(img_name,2) row,col,rad=img_name.split("_")[2:] rad=rad.split(".")[0] DataInput.append(img) DataLabels.append(PreprocessLabels(row,col,rad)) returnnp.expand_dims(np.array(DataInput),axis=3),np.array(DataLabels) defModel(): model=Sequential() model.add(Conv2D(64,kernel_size=3,activation='relu',input_shape=(200,200,1))) model.add(Conv2D(64,kernel_size=5,activation='relu')) model.add(Conv2D(32,kernel_size=3,activation='relu')) model.add(Flatten()) model.add(Dense(4,activation='linear',use_bias=False,kernel_initializer="he_normal")) returnmodel FileList=glob("images/*.png") x,y=DataGenerator(FileList) model=Model() model.compile(optimizer='adam',loss=GIoULoss()) model.fit(x,y,batch_size=64,epochs=10,verbose=1,validation_split=0.2,shuffle=True,) Thetextwasupdatedsuccessfully,buttheseerrorswereencountered: Allreactions shun-lin added the losses label Jan31,2020 Copylink Member seanpmorgan commented Jan31,2020 @nimish1512Thanksforraisingtheissue.Unfortunatelywecan'taskmaintainerstotroubleshoottrainingcodeasthereisnoexpectedresult(especiallygiventheunknowndatasetyourusing). Pleasecreateaminimalreproducibleexample(similartoatestcase)thatcanbeverifiedbyamaintainer.ForexampleifyouthinkGIoULossdoesn'tgobelow1,thencreateanexampleinputthatshouldandshowhowitsbroken. Apologiesfortheless-than-helpfulanswerbutwehavetokeepmaintainabilityapriority.HavingmaintainersdebugentireMLpipelinesisverydifficultandtimeconsuming. 👍 1 Squadrickreactedwiththumbsupemoji Allreactions 👍 1reaction Sorry,somethingwentwrong. seanpmorgan closedthisascompleted Jan31,2020 Copylink betamoo commented Jan19,2021 Iamhavingthesameproblemaswell,thelossreaches1andstaysthere! 👍 2 chr-petersandoricoureactedwiththumbsupemoji Allreactions 👍 2reactions Sorry,somethingwentwrong. Copylink FabianMoenkeberg commented Feb11,2021 Sameproblemhere... 👍 1 chr-petersreactedwiththumbsupemoji Allreactions 👍 1reaction Sorry,somethingwentwrong. Copylink JoelMaldonadoRuiz commented Jul12,2022 Sameproblemaswell. Allreactions Sorry,somethingwentwrong. Copylink JoelMaldonadoRuiz commented Jul13,2022 Seemslikeaddingnormalizationfixeditforme Allreactions Sorry,somethingwentwrong. Signupforfree tojointhisconversationonGitHub. Alreadyhaveanaccount? Signintocomment Assignees Nooneassigned Labels losses Projects Noneyet Milestone Nomilestone Development Nobranchesorpullrequests 6participants Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.
延伸文章資訊
- 1addons/giou_loss.py at master · tensorflow/addons - GitHub
GIoU is an enhancement for models which use IoU in object detection. Usage: >>> gl = tfa.losses ...
- 2GIoULoss doesn't go below 1 · Issue #982 · tensorflow/addons
... prediction problem # where we can use GIoU as our loss function. x1 = int(row)-int(rad) y1 = ...
- 3設計一個Tracking追蹤CNN模型 - CH.Tseng
... 基本上該addon就是輸入實際及預測的兩組bbox,便可得到GIOU loss:. import tensorflow_addons as tfa. model.compile( opt...
- 4無題
This repo implements both GIoU-loss and DIoU-loss for rotated bounding boxes. ... I found this vi...
- 5Understanding the GIoU loss function in tensorflow