Coder Social home page Coder Social logo

Comments (8)

praeclarumjj3 avatar praeclarumjj3 commented on June 3, 2024

Hi @momo1986, the error arises because you probably do not prepare an input text in your dataset mapper. Are you sure you are using the correct dataset mapper?

if self.training:
texts = torch.cat([self.text_tokenizer(x["text"]).to(self.device).unsqueeze(0) for x in batched_inputs], dim=0)

from oneformer.

momo1986 avatar momo1986 commented on June 3, 2024

Hi, @praeclarumjj3.

Thanks for your reply.

I know that the evaluation dataset should be given the token "text" to enable the training mode.

Is there a demo that "text" field could be edited and set in a correct parameter when "--eval-only" is given.

I wish you are all good.

Best Wishes!
Yours Sincerely,
Momo

from oneformer.

praeclarumjj3 avatar praeclarumjj3 commented on June 3, 2024

Hi @momo1986, you would need to create a "text" list inside the evaluation dataset mapper if you want to use it during inference.

You can take a look at the training dataset mapper for reference.

from oneformer.

momo1986 avatar momo1986 commented on June 3, 2024
image Hi, I have generated the panoptic file as README.md prompted.

I also set as the training mode.
python train_net_adv.py --num-gpus 1 --config-file configs/cityscapes/convnext/oneformer_convnext_large_bs16_90k.yaml --eval-only MODEL.IS_TRAIN True MODEL.WEIGHTS 250_16_convnext_l_oneformer_cityscapes_90k.pth MODEL.TEST.TASK semantic
However, I obtained the error.

This is the error log.

Traceback (most recent call last):
File "train_net_adv.py", line 438, in
launch(
File "/home/ubuntu/junyan/Python/segmentation/detectron2/detectron2/engine/launch.py", line 84, in launch
main_func(*args)
File "train_net_adv.py", line 419, in main
res = Trainer.test(cfg, model)
File "train_net_adv.py", line 369, in test
results_i = inference_on_dataset(model, data_loader, evaluator)
File "/home/ubuntu/junyan/Python/segmentation/detectron2/detectron2/evaluation/evaluator.py", line 241, in inference_on_dataset
for idx, inputs in enumerate(data_loader):
File "/home/ubuntu/anaconda3/envs/oneformer/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/home/ubuntu/anaconda3/envs/oneformer/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/home/ubuntu/anaconda3/envs/oneformer/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/home/ubuntu/anaconda3/envs/oneformer/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/oneformer/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/home/ubuntu/anaconda3/envs/oneformer/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/ubuntu/anaconda3/envs/oneformer/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/ubuntu/junyan/Python/segmentation/detectron2/detectron2/data/common.py", line 95, in getitem
data = self._map_func(self._dataset[cur_idx])
File "/home/ubuntu/junyan/Python/segmentation/detectron2/detectron2/utils/serialize.py", line 26, in call
return self._obj(*args, **kwargs)
File "/home/ubuntu/junyan/Python/segmentation/OneFormer/oneformer/data/dataset_mappers/oneformer_unified_dataset_mapper.py", line 301, in call
raise ValueError(
ValueError: Cannot find 'pan_seg_file_name' for panoptic segmentation dataset datasets/cityscapes/leftImg8bit/val/frankfurt/frankfurt_000001_062250_leftImg8bit.png.

I feel sorry for disturing you. Nevertheless, I am looking forward to addressing the problem.

Thanks & Regards!
Yours Sincerely,
Momo

from oneformer.

momo1986 avatar momo1986 commented on June 3, 2024

Looks the pan seg file is existed, how can I link them together?
image
The file structure is set as recommended.

Thanks & Best wishes!
Regards!
Momo

from oneformer.

momo1986 avatar momo1986 commented on June 3, 2024

Looks like that the model would touch the task of panoptic segmentation when the mode is set to the training model. However, for attacking adversarially in the inference time, evaluation only on semantic segmentation is what we want? Is there any workaround in UI to skip this issue?
Thanks & Regards!
Momo

from oneformer.

praeclarumjj3 avatar praeclarumjj3 commented on June 3, 2024

Hi @momo1986, were you able to solve this issue? I am sorry for not being able to reply earlier, been busy.

from oneformer.

praeclarumjj3 avatar praeclarumjj3 commented on June 3, 2024

I am closing this issue due to inactivity. Feel free to re-open.

from oneformer.

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.