-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Training with custom dataset. #14
Comments
Hello, Yes, that would be possible. First, you need to subclass the Database class here. After this, you just pass your database class to any of the meta-learning algorithms implemented in this repo, and it will be applied on your dataset. You can see tensorboard logs and saved models as well. If you want you can make a run file for it as well and contribute to the repo. The run file is something like this. |
Hi. Thank you so much for your time and nice explanation. I believe i was able to create the scripts that i needed according to your instruction. But i am getting an error when i run my script. Here is the error:
Any idea why i am getting this? |
If i write
i get |
I see. I believe this is because python interpreter does not find the models module. The way to resolve it is to add the path of the root of the project to your system variable PYTHONPATH. So it would be something like this:
There is also a pythonic way for this as follows: in your myTestRun.py add
|
Hi, thanks for your quick reply. I have manages to solve the problem. Now i have another one. I have faced this problem before and i still haven't been able to fix it. It has got something to do with the shape of the images. The error i am getting is:
Since i have adopted your code written for omniglot, i am assuming the shape of my images don't match with omniglot dataset. |
i think i did not understand how to use the parse_function. I have not used it anywhere. I need to implement that function. But i am not sure about where exactly. |
So you need to write a function similar to this in your database class. In fact this line loads your image assuming it is jpeg image. Note that if your image is not jpeg you have to decode it based on its format or you have to save it as a jpeg before using this. The reshaping happens in this line that uses self.get_input_shape(), you can ignore it for now and just pass some fixed numbers based on your network architecture. For example you can do something like this: |
So let's say this is my subclass:
i add this |
Yes, it is done in the algorithm part. As an example, you can look at this. Just make an instance of your dataset class and pass it to MAML algorithm. Or any other algorithm like UMTRA, Protonets, etc. Also, in your example above, make sure that you indent functions such that they are members of your class. |
Hi, i have done that. Still get this error:
any idea how to fix it? |
If I might suggest a direction of investigation, it might be that you are
starting with some kind of images that have 4 color channels. Almost
always, the last channel is a transparency (alpha) channel, so you can just
drop it.
https://stackoverflow.com/questions/19028830/convert-4-channel-image-to-3-channel-image
cheers
Lotzi
…On Sun, Jan 3, 2021 at 9:27 AM SamiurRahman1 ***@***.***> wrote:
Hi, i have done that. Still get this error:
pywrap_tfe.TFE_ExecutorWaitForAllPendingNodes(self._handle)
tensorflow.python.framework.errors_impl.InvalidArgumentError: PartialTensorShape: Incompatible shapes during merge: [84,84,3] vs. [84,84,4]
[[{{node map_1/TensorArrayV2Stack/TensorListStack}}]]
any idea how to fix it?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#14 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACDUKJFEB5T6FF4M3EYPDE3SYB5GFANCNFSM4VOC3MZA>
.
--
-----
Lotzi Bölöni, PhD
Professor of Computer Science, University of Central Florida
[email protected] http://www.cs.ucf.edu/~lboloni 1-407-823-2320
|
Thank you for your suggestion. I ran the following bit of code:
and i got this output:
Which suggests that my images are already in RGB and the channel is 3. So, i can't find where exactly the error is coming from. |
Can you please check your image shapes when you load them by TensorFlow? To do that you can add a line |
Hmm, Interesting. This is the reply i get if i run
|
is it possible to get this output if the function doesn't get the input images? maybe i made a mistake while providing the input images. can it cause this problem? |
another thing, in the |
I would definitely try to do something like this to see if it solves the problem. |
so, since my code isn't throwing any error and it seems like it is training, i hope it is working and the problem has been solved. Now, i actually applied both of your suggestions so i am not sure which one did the trick. This is how my
I will give an update once my code finishes running. |
I have one more question. How do i read the log files and plot/view my training performance?
for a few hours when it started. Is it normal? |
Hello Samiur, Thank you for using this repository for your project. Glad that you were able to run the training. Just to make sure in the future people can search for issues in repo easily, do you mind to open another issue for your last question since it is another topic? Also, I keep this issue open until we add the description and details of how to use custom datasets to readme of the project. Thanks again for your great questions! |
Hello, i am new to Meta-Learning. For a project, i need to train a model with custom image data. Is it possible for me somehow to use your repo and train a model with my custom data?
Thank you
The text was updated successfully, but these errors were encountered: