Skip to content
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

Retinanet model running error #3

Closed
bovane opened this issue Apr 10, 2020 · 21 comments
Closed

Retinanet model running error #3

bovane opened this issue Apr 10, 2020 · 21 comments

Comments

@bovane
Copy link

bovane commented Apr 10, 2020

Hello,I am a student. I have some doubt about running retinanet model . when I use google colab run retinanet model I couldn't understand the parameters meaning,could you explain for me and help me run correctly ?
截屏2020-04-10 下午11 26 39
By the way, I can execute the faster-rcnn model correctly ! Thank you

@bovane
Copy link
Author

bovane commented Apr 10, 2020

@delmalih

@delmalih
Copy link
Owner

Hello, your issue comes from the way you run the command with colab. Try running the command using one line.

Also, make sure to replace all parameters "<...>" with your own. For example : should be replaced by the batch size you want.

@bovane
Copy link
Author

bovane commented Apr 10, 2020

thank you ,but I can't find the file such as config-file,could you explain it to me ?
截屏2020-04-11 上午12 29 10
@delmalih

@bovane
Copy link
Author

bovane commented Apr 10, 2020

I just download these code and run it with colab , these peramters such as config-file and model.weight I can't find them. So I can't run these command correctly . Could you help me ? I'm stuck for a long time
I‘m a fresh-bird,alway stupied.
截屏2020-04-11 上午12 29 10

Such as for this command, I can't find the config-file ! Are they in your program ?
@delmalih

@delmalih
Copy link
Owner

If you're trying tu run an inference for he faster r-cnn, for the modeil weights, either you train on your own dataset or you can download some pretrained models on the model zoo : https://github.com/facebookresearch/maskrcnn-benchmark/blob/master/MODEL_ZOO.md

For the config file check here : https://github.com/facebookresearch/maskrcnn-benchmark/tree/master/configs
There is plenty of them, try to create your own file or copy/paste an existing one

@bovane
Copy link
Author

bovane commented Apr 10, 2020

Thank you very much ,I will try it again ! Thank you !

@bovane
Copy link
Author

bovane commented Apr 10, 2020

With your help I succeed in training and runing an inference,Thank you ☺️ ,but when I am trying to train the retinanet there are some problem.
截屏2020-04-11 上午12 53 26

train.py: error: argument dataset_type: invalid choice: ' --tensorboard-dir' tensorboard-dir peramters and coco dataset error . I guess wehther I need download coco dataset .tar.gz file ? other than the path ? Could you explain it for me ? Thank you !

@bovane
Copy link
Author

bovane commented Apr 10, 2020

@delmalih

@delmalih
Copy link
Owner

For the tensorboard-dir parameter, you need to give any folder to store some files required for the tensorboard (for ex. /tmp/tensorboard)
After the coco parameter, you need to give the path to your dataset (in the coco format !important!). Take a look at the MSCoco dataset to get this format.

@bovane
Copy link
Author

bovane commented Apr 10, 2020

Thank you very much for your help, I will keep trying

@bovane
Copy link
Author

bovane commented Apr 10, 2020

I'm Sorry for my stupied ! I konw I need to give to my dataset path with coco format ! but I just download the all-mias.tar.gz and use the generate_COCO_annotations.py to create the coco dataset !
截屏2020-04-11 上午2 09 51

then I use the coco path for peramter . I don't understand the dataset should be looklike !

@delmalih
Copy link
Owner

Ok so normally, you should set your dataset_path as "../mias-db/COCO" and it should work. The generate_COCO_annotations.py script creates a COCO like database with the MIAS dataset.

@bovane
Copy link
Author

bovane commented Apr 10, 2020

uh,so sad 😭 😔 😢 🙁 I can't run the retinanet correctly ! for coco dataset path I use absolutely path .
截屏2020-04-11 上午2 32 51

@delmalih
Copy link
Owner

First, remove all "", we use them only if we want to write commands on multiple lines.
Then, put your paths between quotation marks "/content/drive/...."

@bovane
Copy link
Author

bovane commented Apr 10, 2020

I have tried use the quotation marks my coco dataset pathway,but still fail

@delmalih
Copy link
Owner

Could you send me the entire command you used to run the training process ? Along with its output

@bovane
Copy link
Author

bovane commented Apr 10, 2020

ok,I will !
this is your model command line
!python train.py --compute-val-loss \ # Computer val loss or not
--tensorboard-dir
--batch-size
--epochs
coco

then I use :
!python train.py --compute-val-loss \ # Computer val loss or not
--tensorboard-dir output/
--batch-size 20
--epochs 10
coco /content/drive/Shared drives/BoVane/mias-db/COCO

then it will occur the error IndentationError: unexpected indent !!!

when I use the single command line like this:
!python train.py --compute-val-loss \ --tensorboard-dir output/ \ --batch-size 20 \ --epochs 10 \ coco /content/drive/Shared drives/BoVane/mias-db/COCO

Using TensorFlow backend.
2020-04-10 18:49:44.153250: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
usage: train.py [-h]
[--snapshot SNAPSHOT | --imagenet-weights | --weights WEIGHTS | --no-weights]
[--backbone BACKBONE] [--batch-size BATCH_SIZE] [--gpu GPU]
[--multi-gpu MULTI_GPU] [--multi-gpu-force] [--epochs EPOCHS]
[--steps STEPS] [--lr LR] [--snapshot-path SNAPSHOT_PATH]
[--tensorboard-dir TENSORBOARD_DIR] [--no-snapshots]
[--no-evaluation] [--freeze-backbone] [--random-transform]
[--image-min-side IMAGE_MIN_SIDE]
[--image-max-side IMAGE_MAX_SIDE] [--config CONFIG]
[--weighted-average] [--compute-val-loss] [--multiprocessing]
[--workers WORKERS] [--max-queue-size MAX_QUEUE_SIZE]
{coco,pascal,kitti,oid,csv} ...
train.py: error: argument dataset_type: invalid choice: ' ' (choose from 'coco', 'pascal', 'kitti', 'oid', 'csv')

@delmalih
Copy link
Owner

Try this command :

!python train.py --compute-val-loss --tensorboard-dir "/tmp/tensorboard-dir" --batch-size 20 --epochs 10 coco "/content/drive/Shared drives/BoVane/mias-db/COCO"

@bovane
Copy link
Author

bovane commented Apr 10, 2020

wow 🤩 😯 😲 ! I can run this command Thank you !
but there is another error !
Using TensorFlow backend.
2020-04-10 18:53:19.156283: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.1
Traceback (most recent call last):
File "train.py", line 511, in
main()
File "train.py", line 440, in main
keras.backend.tensorflow_backend.set_session(get_session())
File "train.py", line 50, in get_session
config = tf.ConfigProto()
AttributeError: module 'tensorflow' has no attribute 'ConfigProto'

I am just finding the train.py to fix the bug ! Thank you 🙏 😊 ☺️

@delmalih
Copy link
Owner

Check your tf version and make sure that it is compatible with the code

@bovane
Copy link
Author

bovane commented Apr 10, 2020

yep ! I really appreciate your help, now I only have fcos model left !

@bovane bovane closed this as completed Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants