From 9b675ba1ee323b9a01eab153ba9fc5b3670c7a89 Mon Sep 17 00:00:00 2001 From: Sricharan Reddy Varra Date: Thu, 28 Sep 2023 12:38:16 -0700 Subject: [PATCH 1/6] added environment.yml files for macOS and Linux --- .gitignore | 2 + environment-linux.yml | 16 +++++ environment-macOS.yml | 14 ++++ pyproject.toml | 9 +-- src/deepcell/layers.py | 10 ++- templates/1_Nimbus_Predict.ipynb | 107 +++++++++++++++++++++++++------ 6 files changed, 130 insertions(+), 28 deletions(-) create mode 100644 environment-linux.yml create mode 100644 environment-macOS.yml diff --git a/.gitignore b/.gitignore index f9761d9..756247c 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,5 @@ cython_debug/ .vscode .DS_Store coverage.lcov +data/ +*.h5 \ No newline at end of file diff --git a/environment-linux.yml b/environment-linux.yml new file mode 100644 index 0000000..090e49a --- /dev/null +++ b/environment-linux.yml @@ -0,0 +1,16 @@ +name: Nimbus_macOS +channels: + - defaults + - conda-forge +dependencies: + - cudatoolkit=11.8.0 + - python=3.11 + - pip + - hdf5 + - numpy + - pip: + - nvidia-cudnn-cu11==8.6.0.163 + - tensorflow==2.13.* + - tensorflow-macos==2.13 + - tensorflow-metal==1.0.1 + - . diff --git a/environment-macOS.yml b/environment-macOS.yml new file mode 100644 index 0000000..8f0a77d --- /dev/null +++ b/environment-macOS.yml @@ -0,0 +1,14 @@ +name: Nimbus_macOS +channels: + - defaults + - conda-forge +dependencies: + - python=3.11 + - pip + - hdf5 + - numpy + - pip: + - tensorflow==2.13.* + - tensorflow-macos==2.13.* + - tensorflow-metal==1.0.1 + - . diff --git a/pyproject.toml b/pyproject.toml index bb054f4..9116944 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,19 +21,20 @@ dependencies = [ "seaborn>=0.12", "alpineer>=0.1.5", "natsort>=7.1", - "tensorflow==2.8", - "protobuf<=3.20", + "tensorflow>=2.12", + "protobuf", ] name = "cell_classification" authors = [{ name = "Angelo Lab", email = "theangelolab@gmail.com" }] description = "Cell classification tool for classifying cells into marker positive and negative for arbitrary markers." readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" license = { text = "Modified Apache License 2.0" } classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "License :: OSI Approved :: Apache Software License", "Topic :: Scientific/Engineering :: Bio-Informatics", "Topic :: Scientific/Engineering :: Image Processing", diff --git a/src/deepcell/layers.py b/src/deepcell/layers.py index b1fc780..f85e2ba 100644 --- a/src/deepcell/layers.py +++ b/src/deepcell/layers.py @@ -31,8 +31,6 @@ from tensorflow.keras import constraints from tensorflow.keras import initializers from tensorflow.keras import regularizers -from keras.utils import conv_utils - logger = tf.get_logger() @@ -52,7 +50,7 @@ class UpsampleLike(Layer): def __init__(self, data_format=None, **kwargs): super().__init__(**kwargs) - self.data_format = conv_utils.normalize_data_format(data_format) + self.data_format = data_format def _resize_drop_axis(self, image, size, axis): image_shape = tf.shape(image) @@ -211,7 +209,7 @@ def __init__(self, self.filter_size = filter_size self.norm_method = norm_method - self.data_format = conv_utils.normalize_data_format(data_format) + self.data_format = data_format if self.data_format == 'channels_first': self.channel_axis = 1 @@ -343,7 +341,7 @@ def __init__(self, data_format=None, **kwargs): logger.warn('in_shape (from deepcell.layerse.location) is ' 'deprecated and will be removed in a future version.') super().__init__(**kwargs) - self.data_format = conv_utils.normalize_data_format(data_format) + self.data_format = data_format def compute_output_shape(self, input_shape): input_shape = tensor_shape.TensorShape(input_shape).as_list() @@ -406,7 +404,7 @@ def __init__(self, data_format=None, **kwargs): logger.warn('in_shape (from deepcell.layerse.location) is ' 'deprecated and will be removed in a future version.') super().__init__(**kwargs) - self.data_format = conv_utils.normalize_data_format(data_format) + self.data_format = data_format def compute_output_shape(self, input_shape): input_shape = tensor_shape.TensorShape(input_shape).as_list() diff --git a/templates/1_Nimbus_Predict.ipynb b/templates/1_Nimbus_Predict.ipynb index f736fbd..d5a2a2c 100644 --- a/templates/1_Nimbus_Predict.ipynb +++ b/templates/1_Nimbus_Predict.ipynb @@ -10,10 +10,24 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "f920e689", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2023-09-28T19:09:30.004569Z", + "start_time": "2023-09-28T19:09:27.171139Z" + } + }, + "outputs": [ + { + "data": { + "text/plain": "", + "text/html": "" + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "# import required packages\n", "import warnings\n", @@ -47,9 +61,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "974f8dda", - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-09-28T19:09:30.008473Z", + "start_time": "2023-09-28T19:09:30.005361Z" + } + }, "outputs": [], "source": [ "# set up the base directory\n", @@ -66,9 +85,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "37733de5", - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-09-28T19:09:31.363599Z", + "start_time": "2023-09-28T19:09:30.008623Z" + } + }, "outputs": [], "source": [ "example_dataset.get_example_dataset(dataset=\"cluster_pixels\", save_dir = base_dir, overwrite_existing = False)" @@ -86,9 +110,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "292e4524", - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-09-28T19:09:31.367102Z", + "start_time": "2023-09-28T19:09:31.364755Z" + } + }, "outputs": [], "source": [ "# set up file paths\n", @@ -114,9 +143,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "65a319c9", - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-09-28T19:09:31.370417Z", + "start_time": "2023-09-28T19:09:31.368471Z" + } + }, "outputs": [], "source": [ "# define the channels to exclude\n", @@ -156,10 +190,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "fc8256e6", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2023-09-28T19:09:31.373464Z", + "start_time": "2023-09-28T19:09:31.371859Z" + } + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Segmentation data exists for fov 0 and naming convention is correct\n" + ] + } + ], "source": [ "# Prepare segmentation naming convention that maps a fov_path to the according segmentation label map\n", "segmentation_naming_convention = prep_deepcell_naming_convention(deepcell_output_dir)\n", @@ -182,10 +229,29 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "7fd0a575", - "metadata": {}, - "outputs": [], + "metadata": { + "ExecuteTime": { + "end_time": "2023-09-28T19:23:03.276854Z", + "start_time": "2023-09-28T19:22:59.098274Z" + } + }, + "outputs": [ + { + "ename": "FileNotFoundError", + "evalue": "Could not find Nimbus weights at /opt/homebrew/Caskroom/mambaforge/base/envs/Nimbus_macOS/lib/python3.11/checkpoints/halfres_512_checkpoint_160000.h5.", + "output_type": "error", + "traceback": [ + "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[0;31mFileNotFoundError\u001B[0m Traceback (most recent call last)", + "Cell \u001B[0;32mIn[8], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m nimbus \u001B[38;5;241m=\u001B[39m \u001B[43mNimbus\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 2\u001B[0m \u001B[43m \u001B[49m\u001B[43mfov_paths\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mfov_paths\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3\u001B[0m \u001B[43m \u001B[49m\u001B[43msegmentation_naming_convention\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43msegmentation_naming_convention\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 4\u001B[0m \u001B[43m \u001B[49m\u001B[43moutput_dir\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mnimbus_output_dir\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 5\u001B[0m \u001B[43m \u001B[49m\u001B[43mexclude_channels\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mexclude_channels\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 6\u001B[0m \u001B[43m \u001B[49m\u001B[43msave_predictions\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43;01mTrue\u001B[39;49;00m\u001B[43m,\u001B[49m\n\u001B[1;32m 7\u001B[0m \u001B[43m \u001B[49m\u001B[43mbatch_size\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;241;43m4\u001B[39;49m\u001B[43m,\u001B[49m\n\u001B[1;32m 8\u001B[0m \u001B[43m \u001B[49m\u001B[43mtest_time_aug\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43;01mTrue\u001B[39;49;00m\u001B[43m,\u001B[49m\n\u001B[1;32m 9\u001B[0m \u001B[43m \u001B[49m\u001B[43minput_shape\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43m[\u001B[49m\u001B[38;5;241;43m1024\u001B[39;49m\u001B[43m,\u001B[49m\u001B[38;5;241;43m1024\u001B[39;49m\u001B[43m]\u001B[49m\n\u001B[1;32m 10\u001B[0m \u001B[43m)\u001B[49m\n\u001B[1;32m 12\u001B[0m \u001B[38;5;66;03m# check if all inputs are valid\u001B[39;00m\n\u001B[1;32m 13\u001B[0m nimbus\u001B[38;5;241m.\u001B[39mcheck_inputs()\n", + "File \u001B[0;32m/opt/homebrew/Caskroom/mambaforge/base/envs/Nimbus_macOS/lib/python3.11/site-packages/cell_classification/application.py:108\u001B[0m, in \u001B[0;36mNimbus.__init__\u001B[0;34m(self, fov_paths, segmentation_naming_convention, output_dir, save_predictions, exclude_channels, half_resolution, batch_size, test_time_aug, input_shape)\u001B[0m\n\u001B[1;32m 105\u001B[0m os\u001B[38;5;241m.\u001B[39mmakedirs(\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39moutput_dir, exist_ok\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mTrue\u001B[39;00m)\n\u001B[1;32m 107\u001B[0m \u001B[38;5;66;03m# initialize model and parent class\u001B[39;00m\n\u001B[0;32m--> 108\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43minitialize_model\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 110\u001B[0m \u001B[38;5;28msuper\u001B[39m(Nimbus, \u001B[38;5;28mself\u001B[39m)\u001B[38;5;241m.\u001B[39m\u001B[38;5;21m__init__\u001B[39m(\n\u001B[1;32m 111\u001B[0m model\u001B[38;5;241m=\u001B[39m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mmodel, \n\u001B[1;32m 112\u001B[0m model_image_shape\u001B[38;5;241m=\u001B[39m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mmodel\u001B[38;5;241m.\u001B[39minput_shape[\u001B[38;5;241m1\u001B[39m:],\n\u001B[0;32m (...)\u001B[0m\n\u001B[1;32m 115\u001B[0m format_model_output_fn\u001B[38;5;241m=\u001B[39mformat_output,\n\u001B[1;32m 116\u001B[0m )\n", + "File \u001B[0;32m/opt/homebrew/Caskroom/mambaforge/base/envs/Nimbus_macOS/lib/python3.11/site-packages/cell_classification/application.py:163\u001B[0m, in \u001B[0;36mNimbus.initialize_model\u001B[0;34m(self)\u001B[0m\n\u001B[1;32m 161\u001B[0m \u001B[38;5;28mprint\u001B[39m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mLoaded weights from \u001B[39m\u001B[38;5;132;01m{}\u001B[39;00m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;241m.\u001B[39mformat(\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcheckpoint_path))\n\u001B[1;32m 162\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m--> 163\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mFileNotFoundError\u001B[39;00m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mCould not find Nimbus weights at \u001B[39m\u001B[38;5;132;01m{}\u001B[39;00m\u001B[38;5;124m.\u001B[39m\u001B[38;5;124m\"\u001B[39m\\\n\u001B[1;32m 164\u001B[0m \u001B[38;5;241m.\u001B[39mformat(\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcheckpoint_path))\n\u001B[1;32m 165\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mmodel \u001B[38;5;241m=\u001B[39m model\n", + "\u001B[0;31mFileNotFoundError\u001B[0m: Could not find Nimbus weights at /opt/homebrew/Caskroom/mambaforge/base/envs/Nimbus_macOS/lib/python3.11/checkpoints/halfres_512_checkpoint_160000.h5." + ] + } + ], "source": [ "nimbus = Nimbus(\n", " fov_paths=fov_paths,\n", @@ -215,7 +281,12 @@ "cell_type": "code", "execution_count": null, "id": "41b100e7", - "metadata": {}, + "metadata": { + "ExecuteTime": { + "end_time": "2023-09-28T19:09:41.384694Z", + "start_time": "2023-09-28T19:09:41.382248Z" + } + }, "outputs": [], "source": [ "nimbus.prepare_normalization_dict(\n", From edf30cacf2c50022040c70fc73ce6c6862169f89 Mon Sep 17 00:00:00 2001 From: Sricharan Reddy Varra Date: Thu, 28 Sep 2023 12:38:38 -0700 Subject: [PATCH 2/6] removed notebook output --- templates/1_Nimbus_Predict.ipynb | 107 ++++++------------------------- 1 file changed, 18 insertions(+), 89 deletions(-) diff --git a/templates/1_Nimbus_Predict.ipynb b/templates/1_Nimbus_Predict.ipynb index d5a2a2c..f736fbd 100644 --- a/templates/1_Nimbus_Predict.ipynb +++ b/templates/1_Nimbus_Predict.ipynb @@ -10,24 +10,10 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "f920e689", - "metadata": { - "ExecuteTime": { - "end_time": "2023-09-28T19:09:30.004569Z", - "start_time": "2023-09-28T19:09:27.171139Z" - } - }, - "outputs": [ - { - "data": { - "text/plain": "", - "text/html": "" - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "metadata": {}, + "outputs": [], "source": [ "# import required packages\n", "import warnings\n", @@ -61,14 +47,9 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "974f8dda", - "metadata": { - "ExecuteTime": { - "end_time": "2023-09-28T19:09:30.008473Z", - "start_time": "2023-09-28T19:09:30.005361Z" - } - }, + "metadata": {}, "outputs": [], "source": [ "# set up the base directory\n", @@ -85,14 +66,9 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "37733de5", - "metadata": { - "ExecuteTime": { - "end_time": "2023-09-28T19:09:31.363599Z", - "start_time": "2023-09-28T19:09:30.008623Z" - } - }, + "metadata": {}, "outputs": [], "source": [ "example_dataset.get_example_dataset(dataset=\"cluster_pixels\", save_dir = base_dir, overwrite_existing = False)" @@ -110,14 +86,9 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "292e4524", - "metadata": { - "ExecuteTime": { - "end_time": "2023-09-28T19:09:31.367102Z", - "start_time": "2023-09-28T19:09:31.364755Z" - } - }, + "metadata": {}, "outputs": [], "source": [ "# set up file paths\n", @@ -143,14 +114,9 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "65a319c9", - "metadata": { - "ExecuteTime": { - "end_time": "2023-09-28T19:09:31.370417Z", - "start_time": "2023-09-28T19:09:31.368471Z" - } - }, + "metadata": {}, "outputs": [], "source": [ "# define the channels to exclude\n", @@ -190,23 +156,10 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "fc8256e6", - "metadata": { - "ExecuteTime": { - "end_time": "2023-09-28T19:09:31.373464Z", - "start_time": "2023-09-28T19:09:31.371859Z" - } - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Segmentation data exists for fov 0 and naming convention is correct\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "# Prepare segmentation naming convention that maps a fov_path to the according segmentation label map\n", "segmentation_naming_convention = prep_deepcell_naming_convention(deepcell_output_dir)\n", @@ -229,29 +182,10 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "7fd0a575", - "metadata": { - "ExecuteTime": { - "end_time": "2023-09-28T19:23:03.276854Z", - "start_time": "2023-09-28T19:22:59.098274Z" - } - }, - "outputs": [ - { - "ename": "FileNotFoundError", - "evalue": "Could not find Nimbus weights at /opt/homebrew/Caskroom/mambaforge/base/envs/Nimbus_macOS/lib/python3.11/checkpoints/halfres_512_checkpoint_160000.h5.", - "output_type": "error", - "traceback": [ - "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", - "\u001B[0;31mFileNotFoundError\u001B[0m Traceback (most recent call last)", - "Cell \u001B[0;32mIn[8], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m nimbus \u001B[38;5;241m=\u001B[39m \u001B[43mNimbus\u001B[49m\u001B[43m(\u001B[49m\n\u001B[1;32m 2\u001B[0m \u001B[43m \u001B[49m\u001B[43mfov_paths\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mfov_paths\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 3\u001B[0m \u001B[43m \u001B[49m\u001B[43msegmentation_naming_convention\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43msegmentation_naming_convention\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 4\u001B[0m \u001B[43m \u001B[49m\u001B[43moutput_dir\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mnimbus_output_dir\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 5\u001B[0m \u001B[43m \u001B[49m\u001B[43mexclude_channels\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43mexclude_channels\u001B[49m\u001B[43m,\u001B[49m\n\u001B[1;32m 6\u001B[0m \u001B[43m \u001B[49m\u001B[43msave_predictions\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43;01mTrue\u001B[39;49;00m\u001B[43m,\u001B[49m\n\u001B[1;32m 7\u001B[0m \u001B[43m \u001B[49m\u001B[43mbatch_size\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;241;43m4\u001B[39;49m\u001B[43m,\u001B[49m\n\u001B[1;32m 8\u001B[0m \u001B[43m \u001B[49m\u001B[43mtest_time_aug\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[38;5;28;43;01mTrue\u001B[39;49;00m\u001B[43m,\u001B[49m\n\u001B[1;32m 9\u001B[0m \u001B[43m \u001B[49m\u001B[43minput_shape\u001B[49m\u001B[38;5;241;43m=\u001B[39;49m\u001B[43m[\u001B[49m\u001B[38;5;241;43m1024\u001B[39;49m\u001B[43m,\u001B[49m\u001B[38;5;241;43m1024\u001B[39;49m\u001B[43m]\u001B[49m\n\u001B[1;32m 10\u001B[0m \u001B[43m)\u001B[49m\n\u001B[1;32m 12\u001B[0m \u001B[38;5;66;03m# check if all inputs are valid\u001B[39;00m\n\u001B[1;32m 13\u001B[0m nimbus\u001B[38;5;241m.\u001B[39mcheck_inputs()\n", - "File \u001B[0;32m/opt/homebrew/Caskroom/mambaforge/base/envs/Nimbus_macOS/lib/python3.11/site-packages/cell_classification/application.py:108\u001B[0m, in \u001B[0;36mNimbus.__init__\u001B[0;34m(self, fov_paths, segmentation_naming_convention, output_dir, save_predictions, exclude_channels, half_resolution, batch_size, test_time_aug, input_shape)\u001B[0m\n\u001B[1;32m 105\u001B[0m os\u001B[38;5;241m.\u001B[39mmakedirs(\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39moutput_dir, exist_ok\u001B[38;5;241m=\u001B[39m\u001B[38;5;28;01mTrue\u001B[39;00m)\n\u001B[1;32m 107\u001B[0m \u001B[38;5;66;03m# initialize model and parent class\u001B[39;00m\n\u001B[0;32m--> 108\u001B[0m \u001B[38;5;28;43mself\u001B[39;49m\u001B[38;5;241;43m.\u001B[39;49m\u001B[43minitialize_model\u001B[49m\u001B[43m(\u001B[49m\u001B[43m)\u001B[49m\n\u001B[1;32m 110\u001B[0m \u001B[38;5;28msuper\u001B[39m(Nimbus, \u001B[38;5;28mself\u001B[39m)\u001B[38;5;241m.\u001B[39m\u001B[38;5;21m__init__\u001B[39m(\n\u001B[1;32m 111\u001B[0m model\u001B[38;5;241m=\u001B[39m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mmodel, \n\u001B[1;32m 112\u001B[0m model_image_shape\u001B[38;5;241m=\u001B[39m\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mmodel\u001B[38;5;241m.\u001B[39minput_shape[\u001B[38;5;241m1\u001B[39m:],\n\u001B[0;32m (...)\u001B[0m\n\u001B[1;32m 115\u001B[0m format_model_output_fn\u001B[38;5;241m=\u001B[39mformat_output,\n\u001B[1;32m 116\u001B[0m )\n", - "File \u001B[0;32m/opt/homebrew/Caskroom/mambaforge/base/envs/Nimbus_macOS/lib/python3.11/site-packages/cell_classification/application.py:163\u001B[0m, in \u001B[0;36mNimbus.initialize_model\u001B[0;34m(self)\u001B[0m\n\u001B[1;32m 161\u001B[0m \u001B[38;5;28mprint\u001B[39m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mLoaded weights from \u001B[39m\u001B[38;5;132;01m{}\u001B[39;00m\u001B[38;5;124m\"\u001B[39m\u001B[38;5;241m.\u001B[39mformat(\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcheckpoint_path))\n\u001B[1;32m 162\u001B[0m \u001B[38;5;28;01melse\u001B[39;00m:\n\u001B[0;32m--> 163\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mFileNotFoundError\u001B[39;00m(\u001B[38;5;124m\"\u001B[39m\u001B[38;5;124mCould not find Nimbus weights at \u001B[39m\u001B[38;5;132;01m{}\u001B[39;00m\u001B[38;5;124m.\u001B[39m\u001B[38;5;124m\"\u001B[39m\\\n\u001B[1;32m 164\u001B[0m \u001B[38;5;241m.\u001B[39mformat(\u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcheckpoint_path))\n\u001B[1;32m 165\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mmodel \u001B[38;5;241m=\u001B[39m model\n", - "\u001B[0;31mFileNotFoundError\u001B[0m: Could not find Nimbus weights at /opt/homebrew/Caskroom/mambaforge/base/envs/Nimbus_macOS/lib/python3.11/checkpoints/halfres_512_checkpoint_160000.h5." - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "nimbus = Nimbus(\n", " fov_paths=fov_paths,\n", @@ -281,12 +215,7 @@ "cell_type": "code", "execution_count": null, "id": "41b100e7", - "metadata": { - "ExecuteTime": { - "end_time": "2023-09-28T19:09:41.384694Z", - "start_time": "2023-09-28T19:09:41.382248Z" - } - }, + "metadata": {}, "outputs": [], "source": [ "nimbus.prepare_normalization_dict(\n", From 802fcc5bca112ddf58688ef4ad59e7e8a3deefd8 Mon Sep 17 00:00:00 2001 From: Sricharan Reddy Varra Date: Thu, 28 Sep 2023 12:43:56 -0700 Subject: [PATCH 3/6] removed tf-macos tf-metal on the linux env file --- environment-linux.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/environment-linux.yml b/environment-linux.yml index 090e49a..69fdc31 100644 --- a/environment-linux.yml +++ b/environment-linux.yml @@ -11,6 +11,4 @@ dependencies: - pip: - nvidia-cudnn-cu11==8.6.0.163 - tensorflow==2.13.* - - tensorflow-macos==2.13 - - tensorflow-metal==1.0.1 - . From 8f99fe683fcf6d90f3f32b6a0c8d0c2d5de73d22 Mon Sep 17 00:00:00 2001 From: Sricharan Reddy Varra Date: Thu, 28 Sep 2023 12:45:59 -0700 Subject: [PATCH 4/6] removed tf-macos for tf versions 2.13 --- environment-macOS.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/environment-macOS.yml b/environment-macOS.yml index 8f0a77d..8743f06 100644 --- a/environment-macOS.yml +++ b/environment-macOS.yml @@ -9,6 +9,5 @@ dependencies: - numpy - pip: - tensorflow==2.13.* - - tensorflow-macos==2.13.* - tensorflow-metal==1.0.1 - . From 8dfead1b82bebd2ed70ea7777beb1b64a07b5e4f Mon Sep 17 00:00:00 2001 From: Sricharan Reddy Varra Date: Thu, 28 Sep 2023 14:02:59 -0700 Subject: [PATCH 5/6] set python 3.11 for test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 28a35a2..767dfca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,10 +16,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Python 3.9 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 cache-dependency-path: "**/pyproject.toml" cache: "pip" From 7cae201ebaad08402527ad4ee9737775a2f557f6 Mon Sep 17 00:00:00 2001 From: Lenz Date: Mon, 23 Oct 2023 18:39:44 +0200 Subject: [PATCH 6/6] Changed python from 3.11 to 3.10 --- .github/workflows/test.yml | 4 ++-- pyproject.toml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 767dfca..b42d737 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,10 +16,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Python 3.11 + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.11 + python-version: 3.10 cache-dependency-path: "**/pyproject.toml" cache: "pip" diff --git a/pyproject.toml b/pyproject.toml index 9116944..eb56080 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,13 +28,12 @@ name = "cell_classification" authors = [{ name = "Angelo Lab", email = "theangelolab@gmail.com" }] description = "Cell classification tool for classifying cells into marker positive and negative for arbitrary markers." readme = "README.md" -requires-python = ">=3.10" +requires-python = "==3.10" license = { text = "Modified Apache License 2.0" } classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", "License :: OSI Approved :: Apache Software License", "Topic :: Scientific/Engineering :: Bio-Informatics", "Topic :: Scientific/Engineering :: Image Processing",