question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HelloWord Test error

See original GitHub issue

After activating InnerEye env, trying to run python InnerEye/ML/runner.py --model=HelloWorld i get this error. Ps. I am following documentation step by step

(**InnerEye) sahand@sahand-System-Product-Name:~/InnerEye-DeepLearning$ export PYTHONPATH=`pwd`
(InnerEye) sahand@sahand-System-Product-Name:~/InnerEye-DeepLearning$ python InnerEye/ML/runner.py --model=HelloWorld
Setting up logging to stdout.
Setting logging level to 20
2020-09-29T16:33:30Z INFO     rpdb is handling traps. To debug: identify the main runner.py process, then as root: kill -TRAP <process_id>; nc 127.0.0.1 4444
2020-09-29T16:33:30Z INFO     Found class HelloWorld in file /home/sahand/InnerEye-DeepLearning/InnerEye/ML/configs/segmentation/HelloWorld.py
2020-09-29T16:33:30Z INFO     Creating the default output folder structure.
2020-09-29T16:33:30Z INFO     Running outside of AzureML.
2020-09-29T16:33:30Z INFO     All results will be written to a subfolder of the project root folder.
2020-09-29T16:33:30Z INFO     Run outputs folder: /home/sahand/InnerEye-DeepLearning/outputs/2020-09-29T163330Z_HelloWorld
2020-09-29T16:33:30Z INFO     Logs folder: /home/sahand/InnerEye-DeepLearning/outputs/2020-09-29T163330Z_HelloWorld/logs
2020-09-29T16:33:30Z INFO     Creating the adjusted output folder structure.
2020-09-29T16:33:30Z INFO     Running outside of AzureML.
2020-09-29T16:33:30Z INFO     All results will be written to a subfolder of the project root folder.
2020-09-29T16:33:30Z INFO     Run outputs folder: /home/sahand/InnerEye-DeepLearning/outputs/2020-09-29T163330Z_HelloWorld
2020-09-29T16:33:30Z INFO     Logs folder: /home/sahand/InnerEye-DeepLearning/outputs/2020-09-29T163330Z_HelloWorld/logs
2020-09-29T16:33:30Z INFO     extra_code_directory is unset
Setting logging level to 20
Setting up logging with level 20 to file /home/sahand/InnerEye-DeepLearning/outputs/2020-09-29T163330Z_HelloWorld/logs/stdout.txt
2020-09-29T16:33:33Z INFO     Setting multiprocessing start method to 'forkserver'
2020-09-29T16:33:33Z INFO     Model training will use the local dataset provided in /home/sahand/InnerEye-DeepLearning/Tests/ML/test_data
2020-09-29T16:33:33Z INFO     
Arguments:
	__center_size_param_value: None
	__dataset_data_frame_param_value: None
	__inference_stride_size_param_value: None
	__largest_connected_component_foreground_classes_param_value: None
	__min_l_rate_param_value: 0
	__model_category_param_value: ModelCategory.Segmentation
	__model_name_param_value: HelloWorld
	__overrides_param_value: None
	__use_gpu_param_value: False
	_architecture_param_value: UNet3D
	_class_weights_param_value: [0.02, 0.49, 0.49]
	_colours_param_value: [(130, 183, 14), (238, 127, 26)]
	_comparison_blob_storage_paths_param_value: None
	_crop_size_param_value: (64, 64, 64)
	_datasets_for_inference: None
	_datasets_for_training: None
	_feature_channels_param_value: [4]
	_file_system_config_param_value: <DeepLearningFileSystemConfig DeepLearningFileSystemConfig00010>
	_fill_holes_param_value: [True, True]
	_ground_truth_ids_display_names_param_value: ['region', 'region_1']
	_ground_truth_ids_param_value: ['region', 'region_1']
	_image_channels_param_value: ['channel1', 'channel2']
	_instance__params : {}
	_l_rate_multi_step_milestones_param_value: None
	_level_param_value: 50
	_local_dataset_param_value: /home/sahand/InnerEye-DeepLearning/Tests/ML/test_data
	_mask_id_param_value: mask
	_multiprocessing_start_method_param_value: MultiprocessingStartMethod.forkserver
	_name_param_value : HelloWorld00008
	_norm_method_param_value: PhotometricNormalizationMethod.CtWindow
	_num_dataload_workers_param_value: 0
	_num_epochs_param_value: 2
	_param_watchers   : {}
	_save_start_epoch_param_value: 1
	_save_step_epochs_param_value: 1
	_slice_exclusion_rules_param_value: []
	_start_epoch_param_value: 0
	_summed_probability_rules_param_value: []
	_tail_param_value : None
	_test_crop_size_param_value: (64, 64, 64)
	_test_diff_epochs_param_value: 1
	_test_start_epoch_param_value: 2
	_test_step_epochs_param_value: 1
	_train_batch_size_param_value: 2
	_use_mixed_precision_param_value: True
	_window_param_value: 200
	initialized       : True
	param             : <param.parameterized.Parameters object at 0x7f3a5dc57b00>

2020-09-29T16:33:33Z INFO     
2020-09-29T16:33:33Z INFO     **** STARTING: Model training **********************************************************************
2020-09-29T16:33:33Z INFO     
2020-09-29T16:33:33Z INFO     Train: 3, Test: 1, and Val: 2. Total subjects: 6
2020-09-29T16:33:33Z INFO     Model Training: Random seed set to: 42
2020-09-29T16:33:33Z INFO     Starting to read and parse the datasets.
2020-09-29T16:33:33Z INFO     Processing dataset (name=None)
2020-09-29T16:33:33Z INFO     Processing dataset (name=None)
2020-09-29T16:33:33Z INFO     Creating the data loader for the training set.
2020-09-29T16:33:33Z INFO     Creating the data loader for the validation set.
2020-09-29T16:33:33Z INFO     Finished creating the data loaders.
2020-09-29T16:33:33Z INFO     Models are saved at /home/sahand/InnerEye-DeepLearning/outputs/2020-09-29T163330Z_HelloWorld/checkpoints
2020-09-29T16:33:33Z INFO     Writing model summary to: logs/model_summaries/model_log001.txt
Attempted to log scalar metric LoggingColumns.NumTrainableParameters:
506139
2020-09-29T16:33:33Z INFO     Making no adjustments to the model because no GPU was found.
2020-09-29T16:33:33Z INFO     Starting training
2020-09-29T16:33:33Z INFO     Starting epoch 1
2020-09-29T16:33:33Z ERROR    Model training/testing failed. Exception: Exception thrown in SimpleITK ReadImage: /tmp/SimpleITK/Code/IO/src/sitkImageReaderBase.cxx:107:
sitk::ERROR: Unable to determine ImageIO reader for "/home/sahand/InnerEye-DeepLearning/Tests/ML/test_data/train_and_test_data/id1_channel1.nii.gz"
Traceback (most recent call last):
  File "InnerEye/ML/runner.py", line 364, in run_in_situ
    self.create_ml_runner().run()
  File "/home/sahand/InnerEye-DeepLearning/InnerEye/ML/run_ml.py", line 308, in run
    model_train(self.model_config, run_recovery)
  File "/home/sahand/InnerEye-DeepLearning/InnerEye/ML/model_training.py", line 150, in model_train
    train_epoch_results = train_or_validate_epoch(training_steps)
  File "/home/sahand/InnerEye-DeepLearning/InnerEye/ML/model_training.py", line 267, in train_or_validate_epoch
    for batch_index, sample in enumerate(train_val_params.data_loader):
  File "/home/sahand/anaconda3/envs/InnerEye/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 363, in __next__
    data = self._next_data()
  File "/home/sahand/anaconda3/envs/InnerEye/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 403, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/home/sahand/anaconda3/envs/InnerEye/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/sahand/anaconda3/envs/InnerEye/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/sahand/InnerEye-DeepLearning/InnerEye/ML/dataset/cropping_dataset.py", line 38, in __getitem__
    sample=super().get_samples_at_index(index=i)[0],
  File "/home/sahand/InnerEye-DeepLearning/InnerEye/ML/dataset/full_image_dataset.py", line 289, in get_samples_at_index
    samples = [io_util.load_images_from_dataset_source(dataset_source=ds)]  # type: ignore
  File "/home/sahand/InnerEye-DeepLearning/InnerEye/ML/utils/io_util.py", line 357, in load_images_from_dataset_source
    images = [load_nifti_image(channel, ImageDataType.IMAGE.value) for channel in dataset_source.image_channels]
  File "/home/sahand/InnerEye-DeepLearning/InnerEye/ML/utils/io_util.py", line 357, in <listcomp>
    images = [load_nifti_image(channel, ImageDataType.IMAGE.value) for channel in dataset_source.image_channels]
  File "/home/sahand/InnerEye-DeepLearning/InnerEye/ML/utils/io_util.py", line 182, in load_nifti_image
    img, header = read_image_as_array_with_header(path)
  File "/home/sahand/InnerEye-DeepLearning/InnerEye/ML/utils/io_util.py", line 146, in read_image_as_array_with_header
    image: sitk.Image = sitk.ReadImage(str(file_path))
  File "/home/sahand/anaconda3/envs/InnerEye/lib/python3.7/site-packages/SimpleITK/SimpleITK.py", line 8876, in ReadImage
    return _SimpleITK.ReadImage(*args)
RuntimeError: Exception thrown in SimpleITK ReadImage: /tmp/SimpleITK/Code/IO/src/sitkImageReaderBase.cxx:107:
sitk::ERROR: Unable to determine ImageIO reader for "/home/sahand/InnerEye-DeepLearning/Tests/ML/test_data/train_and_test_data/id1_channel1.nii.gz"

```**

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
sahand68commented, Sep 29, 2020

Hey! you got it man! thank you so much, somehow I had missed that! my bad!

1reaction
ant0nsccommented, Sep 30, 2020

Thanks a lot @MaherJendoubi for helping @sahand68 resolve this 😃 Closing this issue now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

testing hello, world - Exercise 1.1 - Learn To Solve It
Run the hello, world program on your system. Experiment with leaving out parts of the program, to see what error messages you get....
Read more >
No idea why my tests are failing (hello world) #2466 - GitHub
ERROR : test_hello_with_name (main.BobTests). Traceback (most recent call last): File "hello_world_test.py", line 20, in test_hello_with_name
Read more >
Test Hello World - EdgeWorkers - Akamai TechDocs
Test Hello World · To handle exceptions cleanly write try and catch blocks in your JavaScript code. · Refer to the Limitations section...
Read more >
Hello World error | Cloud Functions Documentation
Demonstrates how to report an error. ... Hello World error. bookmark_border ... An error response code is NOT reported to Error Reporting. //...
Read more >
Hello World sample: "Something went wrong" when installing ...
There is a whitespace in your app Id in shared manifes: "id": " 1CC58D17-1E95-443C-958F-E1F14D4CA3B4". Could you please remove it and try ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found