FedML icon indicating copy to clipboard operation
FedML copied to clipboard

fedcv-image_segmentation problem

Open shuyu0914 opened this issue 3 years ago • 1 comments

Hi ,

I have already install FedML (via conda) and try to run the example of fedcv-image_segmentation . I would like to run 2 client & 1 server with simulation on single machine. But i met some problems when executing bash run_simulation.sh 1 , there is console message:

======== FedML (https://fedml.ai) ========
FedML version: 0.7.286
Execution path:/home/pomchi/miniconda3/envs/fedml/lib/python3.7/site-packages/fedml/__init__.py

======== Running Environment ========
OS: Linux-5.4.0-122-generic-x86_64-with-debian-buster-sid
Hardware: x86_64
Python version: 3.7.13 (default, Mar 29 2022, 02:18:16)
[GCC 7.5.0]
PyTorch version: 1.12.1+cu102
MPI4py is installed

======== CPU Configuration ========
The CPU usage is : 0%
Available CPU Memory: 60.0 G / 62.521270751953125G

======== GPU Configuration ========
NVIDIA GPU Info: <pynvml.nvml.LP_struct_c_nvmlDevice_t object at 0x7f91302019e0>
Available GPU memory: 23.6 G / 24.0G
[]
args.client_id_list = None
training_type != FEDML_TRAINING_PLATFORM_CROSS_DEVICE and training_type != FEDML_TRAINING_PLATFORM_CROSS_SILO
[FedML-Server(0) @device-id-0] [Mon, 08 Aug 2022 10:18:41] [INFO] [__init__.py:531:setup_log_mqtt_mgr] mlops log metrics agent config: mqtt.fedml.ai,1883


ERROR:/home/pomchi/fedml-server/fedml/logs/fedml-run-0-edge-0.log:Uncaught exception
Traceback (most recent call last):
  File "main_fedml_image_segmentation.py", line 18, in <module>
    dataset, class_num = load_data(args)
  File "/home/pomchi/shuyu/FedML/python/app/fedcv/image_segmentation/data/data_loader.py", line 12, in load
    return load_synthetic_data(args)
  File "/home/pomchi/shuyu/FedML/python/app/fedcv/image_segmentation/data/data_loader.py", line 54, in load_synthetic_data
    batch_size=args.batch_size,
TypeError: load_partition_data_cityscapes() missing 1 required positional argument: 'image_size'

My device only have one GPU ( NVIDIA GeForce RTX 3090 ), and i change the setting of fedml_config.yaml

train_args:
client_num_in_total: 2
client_num_per_round: 2 

device_args:
 worker_num: 1
  using_gpu: true
  gpu_mapping_file: config/gpu_mapping.yaml
  gpu_mapping_key: mapping_default

gpu_mapping.yaml

mapping_default:
    pomchi-X299-UD4: [1]

I'm not sure if this setting is correct

Another question is there is no pycocotools module when i import ( at image_segmentation/data/data_loader.py) from .coco.segmentation.data_loader import load_partition_data_coco_segmentation

Traceback (most recent call last):
  File "main_fedml_image_segmentation.py", line 4, in <module>
    from data.data_loader import load as load_data
  File "/home/pomchi/shuyu/FedML/python/app/fedcv/image_segmentation/data/data_loader.py", line 6, in <module>
    from .coco.segmentation.data_loader import load_partition_data_coco_segmentation
  File "/home/pomchi/shuyu/FedML/python/app/fedcv/image_segmentation/data/coco/segmentation/data_loader.py", line 11, in <module>
    from .dataset import CocoSegmentation
  File "/home/pomchi/shuyu/FedML/python/app/fedcv/image_segmentation/data/coco/segmentation/dataset.py", line 12, in <module>
    import pycocotools.mask as coco_mask
ModuleNotFoundError: No module named 'pycocotools'

Any hint and suggestion is highly appreciated !!!

shuyu0914 avatar Aug 08 '22 03:08 shuyu0914

Hi @shuyu0914! For FedCV image segmentation, you need to run the bash script bootstrap.sh in config to install dependencies. You can see the latest code here, and we will release it soon!

yyyanbj avatar Aug 15 '22 02:08 yyyanbj

Closing this due to inactivity. As @beiyuouo already mentioned, the issue has been addressed here.

fedml-dimitris avatar Oct 25 '23 01:10 fedml-dimitris