tensorflow-sentiment-analysis-and-data-read icon indicating copy to clipboard operation
tensorflow-sentiment-analysis-and-data-read copied to clipboard

loss function is 0

Open nnn1988 opened this issue 6 years ago • 1 comments

Hi thank you for the code it is really helpful. However, the loss function is always 0 , can you help me please ? . . .

Batch run: 52/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 53/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 54/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 55/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 56/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 57/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 58/173 | Epoch: 3 | Batch Loss: 0.0 . . . etc

nnn1988 avatar Jul 24 '18 13:07 nnn1988

Hi, I was supposed to update this code to work with tensorflow 1.9 but I have been extremely busy lately.

If you are using an older version of tensorflow, I first suggest using python3. The reason is it automatically converts floating point numbers while python2 requires explicit conversion so that could be giving 0 answer based on multiplying by the int 0 instead of a float between 0.0 and 1.0 somewhere in the calculations in between.

If this does not work, I suggest checking examples on the tensorflow hub website and tensorflow GitHub repo.

I will try to update my repository as soon as I get the chance.

Good Luck and best regards, Sohaib

On Jul 24, 2018 9:32 AM, nnn1988 [email protected] wrote:

Hi thank you for the code it is really helpful. However, the loss function is always 0 , can you help me please ? . . .

Batch run: 52/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 53/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 54/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 55/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 56/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 57/173 | Epoch: 3 | Batch Loss: 0.0 Batch run: 58/173 | Epoch: 3 | Batch Loss: 0.0 . . . etc

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ArifSohaib/tensorflow-sentiment-analysis-and-data-read/issues/4, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALsTMMkqqzGiy4TyzVSXE2QR_pRD6ayIks5uJyIGgaJpZM4Vcv1r.

ArifSohaib avatar Jul 24 '18 19:07 ArifSohaib