For several days I've been looking for a solution to my problem.
I trained a CycleGAN, taken from a project on GitHub, based on TensorFlow. I created the .pb model to perform the inference operations and actually everything works. My problem now is to move the .pb model to Android. I can't use TensorFlow Lite because it has a limited subset of operations and my model is too complex.
I do not understand what I have to do.
How do I make inferences about Android? How do I import and use my .pb file? All the online tutorials are too simple for my model, which is more complex.
I am trying to debug a model I built on Keras and I think that I have a problem with fit_generator. I made a custom data generator to read training data from a database and return them for training with batch_size = 1, since my data have various sizes. Same for validation data.
Problem is that when training my model, it reaches accuracy ~0.98 and loss ~0.002 from the first epoch. It keeps improving for max 2 more epochs and then gets stuck, does not learn anything.
I tried to train on only 20 samples to get a better idea about what's wrong. Noticed that for the 20 samples and 1 epoch training the model behaves well, considering the predictions. But when I get much more training samples, like 2000, the predictions of fscore etc. become literally zero and my visualization are far from expected.
I think there is something wrong with my generator. Right now I expect fit_generator to take as input 1 image and its label (1 batch), and after finishing take the next image. But the problem I mentioned above seems to me like somehow fit_gemerator does not read the data as supposed. Any ideas?
This is that part of my code:
def gen(dataset, batch_size): while True: for batch in range (0, dataset.nb_samples, batch_size): x,y = read_one_sample(batch) # resize, etc. yield(x,y) training_dataset = ... # create instance of database train_gen = gen(dataset, batch_size=1) # same for val generator model.fit_generator(train_gen, steps_per_epoch = training_dataset.nb_samples, validation_data = val_gen, validation_steps = val_dataset.nb_samples, epochs=eppchs)
I am trying to create a basic neural network model in Keras that will learn to add positive numbers together and am having trouble with shaping the training data to fit the model. I detail the issues in this post here for brevity:
First of all I should mention I'm a tensorflow noob. Last time I used tensorflow was long ago, and it was only for a very short time before moving to pytorch.
I'm looking for a simple way to know what layers a tensorflow graph contains. It should be very easy, since as far as I know (correct me if I'm wrong) the graph is static.
In pytorch it would be something like going over all sub-modules in model.modules(), and checking if it is of type torch.nn.Conv2d for example. How would you know if a tensorflow graph contains a convolutional layer?
Is there a website from I can download cpu optimised wheel packages for tensorflow? I tried compiling it from sources but was not able to compile it. I have to install these on multiple machines so I'm looking for wheel packages and not brainstorm to debug compilation on multiple machines. Thanks
Quite excited to be here. I have taken AI/ML courses online but have not actually delved into TF. I am hoping this project will change that. I am trying to steer a gravity-powered soapbox car down a hill with no curves for the 2019 Georgia Google Gravity Games. I am currently equipped with a PI 3 B+, a PI specific camera, a servo motor, the soapbox car itself, and two Corral USB Accelerators.
The environment: is interesting. The lane is linear (no curves), bounded on one-side by double yellow lines, and the other side by haystacks. Photos below:
train a model to recognize haystacks and yellow lines, using photos of the track from the 2017 and 2018 Gravity games, and images of haystacks pulled off the internet.
compute (somehow) the mid-line between the haystacks and the yellow lines. use this as a cross-track for the soapbox car to follow
calculate cross-track error (CTE) and use a PID loop to minimize by steering (heading output)
submit heading to servo motor to actuate alignment of vehicle
If anyone is interested in assisting with this project (I am using it to teach my high-school cousin the basics), please let me know; we will take all the help we can get, and we will be sure to denote your contribution somehow. There is not a financial prize for winning - it's all in the spirit of learning and fun.