hualos icon indicating copy to clipboard operation
hualos copied to clipboard

Got blank webpage

Open sunshineatnoon opened this issue 8 years ago • 9 comments

Awesome project! I use Keras 0.32 with theano backend and add the callback in model.fit_generator() function, but nothing appears on my webpage. Did I do anything wrong? I did get some messages on the command line:

127.0.0.1 - - [2016-03-25 17:00:22] "GET /static/js/c3.min.js HTTP/1.1" 304 191 0.000501
127.0.0.1 - - [2016-03-25 17:00:51] "GET / HTTP/1.1" 200 1717 0.000501
127.0.0.1 - - [2016-03-25 17:00:51] "GET /static/css/c3.min.css HTTP/1.1" 304 189 0.000677
127.0.0.1 - - [2016-03-25 17:00:51] "GET /static/js/d3.min.js HTTP/1.1" 304 191 0.000504
127.0.0.1 - - [2016-03-25 17:00:51] "GET /static/js/jquery.min.js HTTP/1.1" 304 188 0.000452
127.0.0.1 - - [2016-03-25 17:00:51] "GET /static/css/bootstrap.min.css HTTP/1.1" 304 191 0.000442
127.0.0.1 - - [2016-03-25 17:00:51] "GET /static/js/c3.min.js HTTP/1.1" 304 191 0.000434

I use firefox by the way. THX image

sunshineatnoon avatar Mar 25 '16 09:03 sunshineatnoon

I was seeing this as well, but if I use my ip address in the callback instead of 'localhost' the page loaded correctly. You should see something like this below if it's working:

image

tjrileywisc avatar May 03 '16 00:05 tjrileywisc

@sunshineatnoon : Any update on this? Did it work for you? I seem to have the same issue. Nothing shows up on the graph, although the model appears to do fine publishing data to the web server. I tried the solution suggested by @tjrileywisc, using the ip address in the callback instead of 'localhost', still got the blank page. Any advice on this? Appreciate any feedback as soon as you can. Thanks.

dxdoan avatar Jun 23 '16 19:06 dxdoan

@dxdoan What browser are you using? If you bring up the browser's dev console (F12 I think in all browsers, you'll have to double check), do you see any errors listed there?

tjrileywisc avatar Jun 24 '16 00:06 tjrileywisc

@tjrileywisc I'm using Chrome. In the browser dev console's Network tab, besides the successful loads of js and css, I see a request for resource called end/ that's "pending" like forever, and it's requesting the URL http://192.168.99.100:9000/subscribe/epoch/end/ (192.168.99.100 is of course the IP of my virtual machine).

dxdoan avatar Jun 24 '16 14:06 dxdoan

@tjrileywisc I'm not sure if the problem is due to my model script and/or data itself. It runs over only 55 epoches, and it appears to complete them all fine. But right after that, the script encounters an exception. I'm not sure if the graph not showing up is because of this exception? I suspect not, because as soon as the script publishes some data to the server in each epoch (and it does that for the entire 55 epoches), that data should be available for the client to plot on the graph, right? The graph plots data live in basically real-time, right?

dxdoan avatar Jun 26 '16 02:06 dxdoan

Figured out the problem. In file api.py, line 35, the statement self.desc_map.iteritems() causes exception, since I use python 3. Changing it to self.desc_map.items() works.

dxdoan avatar Jun 28 '16 23:06 dxdoan

In my case, when I use the default header, i.e. headers={'Accept': 'application/json', 'Content-Type': 'application/json'}, I get a blank page too. But when I change the header to headers={'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded'}, things seem to get Okay. Can anybody can explain Why? THX

bigben-plusplus avatar Jan 17 '17 10:01 bigben-plusplus

@bigben-plusplus I just had same issues with headers. Not sure why it's happening, but seems to be a result of this commit. Mine also works if I just set headers to None when constructing new instance of RemoteMonitor. https://github.com/fchollet/keras/commit/ad5e29a2b79c62e296e954813db357f87a00d970

cstraton avatar Jan 30 '17 12:01 cstraton

I am using python 3.5.2 and the fix that worked for me is as follow: I created the remote callback with a header equal to None. remote = RemoteMonitor(headers=None)

I updated the encode method in the api.py file to use items() instead of iteritems(). lines = ["%s: %s" % (v, k) for k, v in self.desc_map.items() if k]

Cheers

mez avatar Feb 11 '17 01:02 mez