Giter Club home page Giter Club logo

Comments (2)

hasan1292 avatar hasan1292 commented on August 20, 2024

Hi @xieyufei1993, when training model I got an error such as:
(fots) loitg@loitg-Precision-T3600:~/Desktop/tu_workspace/FOTS$ python main_train.py
use config:
initial_epoch 0
epoch_num 30000
lr 0.001
decay 0.0005
use_gpu True
batch_size 64
num_workers 10
optmizer RMSprop
betas (0.5, 0.999)
epsilon 0.0001
shrink_side_ratio 0.6
shrink_ratio 0.2
model FOTS
patience 2
load_weights False
lambda_inside_score_loss 4.0
lambda_side_vertex_code_loss 1.0
lambda_side_vertex_coord_loss 1.0
load_model_path checkpoints/model.pth
save_path save_model/
total_img 16243
validation_split_ratio 0.1
max_train_img_size 736
max_predict_img_size 2400
parse <bound method parse of <config.DefaultConfig object at 0x7fe4ff6d5cc0>>
end the parse!!!

Epoch 1 / 30000
Traceback (most recent call last):
File "main_train.py", line 95, in
main()
File "main_train.py", line 90, in main
save_step=5, weight_decay=weight_decay)
File "main_train.py", line 32, in train
for i, (img, score_map, geo_map, training_mask) in enumerate(trainloader):
File "/home/loitg/miniconda3/envs/fots/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 582, in next
return self._process_next_batch(batch)
File "/home/loitg/miniconda3/envs/fots/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
File "/home/loitg/miniconda3/envs/fots/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/loitg/Desktop/tu_workspace/FOTS/data/dataset.py", line 672, in collate_fn
images = torch.stack(images, 0)
RuntimeError: expected a non-empty list of Tensors

How to fix this error ?. I hope to see your reply soon.

I am facing the exact error. if someone has workaround, please let me know.

from fots.

ibrahimsoliman97 avatar ibrahimsoliman97 commented on August 20, 2024

If you are using ICDAR dataset, the annotation text file normally has "gt_" before the image name.
So you need to edit your dataset.py file starting from line 581 as below:
if os.path.exists(txt_root + "/gt_"+im_name[0:-4] + '.txt'): txt_fn = "gt_"+im_name[0:-4] + '.txt' elif os.path.exists(txt_root + "/gt_"+im_name[0:-5] + '.txt'): txt_fn = "gt_"+im_name[0:-5] + '.txt'

from fots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.